本文整理了Java中org.eclipse.core.runtime.Assert.isLegal()
方法的一些代码示例,展示了Assert.isLegal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.isLegal()
方法的具体详情如下:
包路径:org.eclipse.core.runtime.Assert
类名称:Assert
方法名:isLegal
[英]Asserts that an argument is legal. If the given boolean is not true
, an IllegalArgumentException
is thrown.
[中]声称论点是合法的。如果给定的布尔值不是true
,则会抛出IllegalArgumentException
。
代码示例来源:origin: org.eclipse.equinox/common
/** Asserts that an argument is legal. If the given boolean is
* not <code>true</code>, an <code>IllegalArgumentException</code>
* is thrown.
*
* @param expression the outcome of the check
* @return <code>true</code> if the check passes (does not return
* if the check fails)
* @exception IllegalArgumentException if the legality test failed
*/
public static boolean isLegal(boolean expression) {
return isLegal(expression, ""); //$NON-NLS-1$
}
代码示例来源:origin: org.eclipse.equinox/common
/**
* Sets the severity.
*
* @param severity the severity; one of <code>OK</code>, <code>ERROR</code>,
* <code>INFO</code>, <code>WARNING</code>, or <code>CANCEL</code>
*/
protected void setSeverity(int severity) {
Assert.isLegal(severity == OK || severity == ERROR || severity == WARNING || severity == INFO || severity == CANCEL);
this.severity = severity;
}
代码示例来源:origin: eclipse/eclipse.jdt.ls
@Override
public void setOptions(CleanUpOptions options) {
Assert.isLegal(options != null);
fOptions = options;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui
@Override
public ImageRegistry getImageRegistry() {
/* Just to be sure that we don't access this
* plug-ins image registry.
*/
Assert.isLegal(false);
return null;
}
代码示例来源:origin: org.eclipse/org.eclipse.ui.workbench.texteditor
/**
* Creates a new descriptor for <code>element</code>.
* <p>
* This method is for internal use only.
* </p>
*
* @param element the extension point element to be described.
*/
public SpellingEngineDescriptor(IConfigurationElement element) {
Assert.isLegal(element != null);
fConfiguration= element;
}
代码示例来源:origin: org.eclipse/org.eclipse.ui.workbench.texteditor
/**
* Creates a new descriptor for <code>element</code>.
* <p>
* This method is for internal use only.
* </p>
*
* @param element the extension point element to be described.
*/
public ReferenceProviderDescriptor(IConfigurationElement element) {
Assert.isLegal(element != null);
fConfiguration= element;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
/**
* Creates a new event.
*
* @param information the revision info
*/
public RevisionEvent(RevisionInformation information) {
Assert.isLegal(information != null);
fInformation= information;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
/**
* @param orientation the orientation, allowed values are: SWT#RIGHT_TO_LEFT or SWT#LEFT_TO_RIGHT
*/
public TemplateInformationControlCreator(int orientation) {
Assert.isLegal(orientation == SWT.RIGHT_TO_LEFT || orientation == SWT.LEFT_TO_RIGHT);
fOrientation= orientation;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
/**
* Creates a new default spell checker.
*
* @param store the preference store for this spell checker
* @param locale the locale
*/
public DefaultSpellChecker(IPreferenceStore store, Locale locale) {
Assert.isLegal(store != null);
Assert.isLegal(locale != null);
fPreferences= store;
fLocale= locale;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
/**
* Creates a new change hover for the given document partitioning.
*
* @param partitioning the document partitioning
* @param orientation the orientation, allowed values are: SWT#RIGHT_TO_LEFT or SWT#LEFT_TO_RIGHT
*/
public JavaChangeHover(String partitioning, int orientation) {
Assert.isLegal(orientation == SWT.RIGHT_TO_LEFT || orientation == SWT.LEFT_TO_RIGHT);
fPartitioning= partitioning;
fOrientation= orientation;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private AssistContext(ICompilationUnit cu, ISourceViewer sourceViewer, IEditorPart editor, int offset, int length, SharedASTProviderCore.WAIT_FLAG waitFlag) {
super(sourceViewer, offset, length);
Assert.isLegal(cu != null);
Assert.isLegal(waitFlag != null);
fCompilationUnit= cu;
fEditor= editor;
fWaitFlag= waitFlag;
}
代码示例来源:origin: eclipse/eclipse.jdt.ls
public Destination(Object destination, int location) {
Assert.isNotNull(destination);
Assert.isLegal(location == LOCATION_AFTER || location == LOCATION_BEFORE || location == LOCATION_ON);
fDestination= destination;
fLocation= location;
}
代码示例来源:origin: org.eclipse/org.eclipse.ui.workbench.texteditor
public boolean matchesClass(Class clazz) {
Assert.isLegal(clazz != null);
do {
if (clazz.getName().equals(fClassName))
return true;
clazz= clazz.getSuperclass();
} while (clazz != null);
return false;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
@Override
public void setStatusMessage(String message) {
Assert.isLegal(message != null);
fMessage= message;
if (fProposalPopup != null)
fProposalPopup.setMessage(message);
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
/**
* Installs the receiver with a text viewer.
*
* @param viewer the viewer to install on
*/
public void install(ITextViewer viewer) {
Assert.isLegal(viewer != null);
fViewer= viewer;
connect();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.core.resources
@Override
public void setReferencedProjects(IProject[] value) {
Assert.isLegal(value != null);
staticRefs = copyAndRemoveDuplicates(value);
clearCachedDynamicReferences(null);
}
代码示例来源:origin: org.eclipse/org.eclipse.ui.workbench.texteditor
public final boolean isColumnVisible(RulerColumnDescriptor descriptor) {
Assert.isLegal(descriptor != null);
CompositeRuler ruler= getRuler();
return ruler != null && getVisibleColumn(ruler, descriptor) != null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
@Override
public void showHyperlinks(IHyperlink[] hyperlinks) {
Assert.isLegal(hyperlinks != null && hyperlinks.length == 1);
highlightRegion(hyperlinks[0].getHyperlinkRegion());
}
代码示例来源:origin: inspectIT/inspectIT
/**
* Checks that the editor input has profile with the {@link ExcludeRulesProfileData}. If so,
* sets the {@link #profile} and {@link #profileData}.
*/
private void checkAndGetEditorInput() {
ProfileEditorInput input = (ProfileEditorInput) formPage.getEditor().getEditorInput();
Assert.isNotNull(input.getProfile());
Assert.isNotNull(input.getProfile().getProfileData());
Assert.isLegal(input.getProfile().getProfileData().isOfType(ExcludeRulesProfileData.class), "Given profile can not be opened with the exclude rules part.");
profile = input.getProfile();
profileData = profile.getProfileData().getIfInstance(ExcludeRulesProfileData.class);
}
代码示例来源:origin: inspectIT/inspectIT
/**
* Checks that the editor input has profile with the {@link SensorAssignmentProfileData}. If so,
* sets the {@link #profile} and {@link #profileData}.
*/
private void checkAndGetEditorInput() {
ProfileEditorInput input = (ProfileEditorInput) formPage.getEditor().getEditorInput();
Assert.isNotNull(input.getProfile());
Assert.isNotNull(input.getProfile().getProfileData());
Assert.isLegal(input.getProfile().getProfileData().isOfType(SensorAssignmentProfileData.class), "Given profile can not be opened with the exclude rules part.");
this.profile = input.getProfile();
this.profileData = profile.getProfileData().getIfInstance(SensorAssignmentProfileData.class);
}
内容来源于网络,如有侵权,请联系作者删除!