当前位置: 首页>>代码示例>>Java>>正文


Java Assert.isLegal方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.Assert.isLegal方法的典型用法代码示例。如果您正苦于以下问题:Java Assert.isLegal方法的具体用法?Java Assert.isLegal怎么用?Java Assert.isLegal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.Assert的用法示例。


在下文中一共展示了Assert.isLegal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getByName

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * @see Model#getByName(String)
 */
public static Model getByName(final String fullQualifiedModelName) {
	Assert.isNotNull(fullQualifiedModelName);
	Assert.isLegal(!fullQualifiedModelName.contains(Model.SPEC_MODEL_DELIM), "Not a full-qualified model name.");
	
       final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
       final ILaunchConfigurationType launchConfigurationType = launchManager
               .getLaunchConfigurationType(TLCModelLaunchDelegate.LAUNCH_CONFIGURATION_TYPE);

	try {
		final ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(launchConfigurationType);
		for (int i = 0; i < launchConfigurations.length; i++) {
			// Can do equals here because of full qualified name.
			final ILaunchConfiguration launchConfiguration = launchConfigurations[i];
			if (fullQualifiedModelName.equals(launchConfiguration.getName())) {
				return launchConfiguration.getAdapter(Model.class);
			}
		}
	} catch (CoreException shouldNeverHappen) {
		shouldNeverHappen.printStackTrace();
	}
	
	return null;
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:27,代码来源:TLCModelFactory.java

示例2: getTLCJob

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
@Override
public Job getTLCJob(String aName, File aModelFolder, int numberOfWorkers, final Properties props, String tlcparams) {
	Assert.isNotNull(aName);
	Assert.isLegal(numberOfWorkers > 0);
	if (AWS_EC2.equals(aName)) {
		return new CloudDistributedTLCJob(aName, aModelFolder, numberOfWorkers, props,
				new EC2CloudTLCInstanceParameters(tlcparams, numberOfWorkers));
	} else if (AWS_EC2_VM_PROPERTIES.equals(aName)) {
		return new CloudDistributedTLCJob(aName, aModelFolder, numberOfWorkers, props,
				new EC2PropertyCloudTLCInstanceParameters(tlcparams, numberOfWorkers));
	} else if (AZURECOMPUTE.equals(aName)) {
		return new CloudDistributedTLCJob(aName, aModelFolder, numberOfWorkers, props,
				new AzureCloudTLCInstanceParameters(tlcparams, numberOfWorkers));
	}
	throw new IllegalArgumentException(aName + " is an unknown cloud");
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:17,代码来源:CloudTLCJobFactory.java

示例3: UsageEventType

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * @param componentName May not be null. All whitespaces will be replaced by "-".
 * @param componentVersion May not be null
 * @param categoryName If null, the component name is used as category name. All whitespaces will be replaced by "-".
 * @param actionName May not be null. All whitespaces will be replaced by "-".
 * @param labelDescription Optinal. May be null.
 * @param valueDescription Optinal. May be null.
 */
public UsageEventType(String componentName, String componentVersion,
        String actionName, String valueDescription) {
    Assert.isLegal(componentName!=null, "Component name may not be null");
    Assert.isLegal(componentVersion!=null, "Component version may not be null"); //$NON-NLS-1$
    Assert.isLegal(actionName != null, "Action name may not be null"); //$NON-NLS-1$
    this.componentName = componentName.replaceAll("\\s", "-");
    this.componentVersion = componentVersion;
    this.actionName = actionName.replaceAll("\\s", "-");
    this.valueDescription = valueDescription;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:19,代码来源:UsageEventType.java

示例4: blend

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * Returns an RGB that lies between the given foreground and background
 * colors using the given mixing factor. A <code>factor</code> of 1.0 will produce a
 * color equal to <code>fg</code>, while a <code>factor</code> of 0.0 will produce one
 * equal to <code>bg</code>.
 * @param bg the background color
 * @param fg the foreground color
 * @param factor the mixing factor, must be in [0,&nbsp;1]
 *
 * @return the interpolated color
 */
private static RGB blend(RGB bg, RGB fg, float factor) {
	// copy of org.eclipse.jface.internal.text.revisions.Colors#blend(..)
	Assert.isLegal(bg != null);
	Assert.isLegal(fg != null);
	Assert.isLegal(factor >= 0f && factor <= 1f);

	float complement = 1f - factor;
	return new RGB((int) (complement * bg.red + factor * fg.red),
			(int) (complement * bg.green + factor * fg.green),
			(int) (complement * bg.blue + factor * fg.blue));
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:23,代码来源:PopupDialog.java

示例5: TeXSpellingProblemCollector

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * Initializes this collector with the given annotation model.
 *
 * @param annotationModel the annotation model
 */
public TeXSpellingProblemCollector(IAnnotationModel annotationModel) {
    Assert.isLegal(annotationModel != null);
    fAnnotationModel= annotationModel;
    if (fAnnotationModel instanceof ISynchronizable)
        fLockObject= ((ISynchronizable)fAnnotationModel).getLockObject();
    else
        fLockObject= fAnnotationModel;
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:14,代码来源:TeXSpellingReconcileStrategy.java

示例6: setOptions

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void setOptions(final CleanUpOptions options) {
	Assert.isLegal(options != null);
	Assert.isTrue(this.options == null);
	this.options = options;
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:10,代码来源:CopyrightUpdaterCleanUp.java

示例7: CompilationUnitRewriteOperationsFix

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
public CompilationUnitRewriteOperationsFix(String name, CompilationUnit compilationUnit, CompilationUnitRewriteOperation[] operations) {
	super(name);
	Assert.isNotNull(operations);
	Assert.isLegal(operations.length > 0);
	fCompilationUnit= compilationUnit;
	fOperations= operations;
	fLinkedProposalModel= new LinkedProposalModel();
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:9,代码来源:CompilationUnitRewriteOperationsFix.java

示例8: LargeTextStoreDocument

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
public LargeTextStoreDocument(long size) {
	if (size != SIZE_UNKNOWN) {
		Assert.isLegal(size >= 0, "Negative file size");
		if (size > Integer.MAX_VALUE) {
			size = Integer.MAX_VALUE - 1;
		}
		setTextStore(new GapTextStore((int) size, (int) size + 1, 0.1f));
	}
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:10,代码来源:TagBasedTLCOutputIncrementalParser.java

示例9: install

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
public void install(ITextEditor editor, ProjectionViewer viewer, IPreferenceStore store) {
	Assert.isLegal(editor != null);
	Assert.isLegal(viewer != null);

	internalUninstall();
	fStore = store;

	if (editor instanceof FluentMkEditor) {
		fEditor = (FluentMkEditor) editor;
		fProjectionListener = new ProjectionListener(viewer);
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:13,代码来源:FoldingStructureProvider.java

示例10: pageToId

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
protected String pageToId(InstallationPage page) {
	String pageId = (String) pageToId.get(page);
	Assert.isLegal(pageId != null);
	return pageId;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:6,代码来源:HydrographInstallationDialog.java

示例11: setInput

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * {@inheritDoc} This control can handle {@link String}(no handle) and
 */
public void setInput(Object input) {
	Assert.isLegal(input == null || input instanceof String || input instanceof de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput);
	
	if (input instanceof String) {
		setInformation((String)input);
		return;
	}
	
	fInput= (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput) input;
	
	String content= null;
	if (fInput != null)		content= fInput.getHtml();
	
	fBrowserHasContent= content != null && content.length() > 0;
	
	if (!fBrowserHasContent)		content= "<html><body ></html>";
	
	boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
	boolean resizable= isResizable();
	
	// The default "overflow:auto" would not result in a predictable width for the
	// client area and the re-wrapping would cause visual noise
	String[] styles= null;
	if (RTL && resizable) {
		styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" };
	} else if (RTL && !resizable) {
		styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" };
	} else if (!resizable) {
		// XXX: In IE, "word-wrap: break-word;" causes bogus wrapping even in non-broken
		// words :-(see e.g. Javadoc of String). Re-check whether we really still need
		// this now that the Javadoc Hover header already sets this style.
		styles= new String[] { "overflow:hidden;"/*, "word-wrap: break-word;"*/ };
	} else {
		styles= new String[] { "overflow:scroll;" };
	}
	
	StringBuffer buffer= new StringBuffer(content);
	de.darwinspl.preferences.resource.dwprofile.ui.DwprofileHTMLPrinter.insertStyles(buffer, styles);
	content= buffer.toString();
	
	// XXX: Should add some JavaScript here that shows something like "(continued...)"
	// or "..." at the end of the visible area when the page overflowed with
	// "overflow:hidden;".
	
	fCompleted= false;
	fBrowser.setText(content);
	
	Object[] listeners= fInputChangeListeners.getListeners();
	for (int i= 0; i < listeners.length; i++) {
		((IInputChangedListener)listeners[i]).inputChanged(fInput);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:DwprofileBrowserInformationControl.java

示例12: setInput

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * {@inheritDoc} This control can handle {@link String}(no handle) and
 */
public void setInput(Object input) {
	Assert.isLegal(input == null || input instanceof String || input instanceof eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput);
	
	if (input instanceof String) {
		setInformation((String)input);
		return;
	}
	
	fInput= (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput) input;
	
	String content= null;
	if (fInput != null)		content= fInput.getHtml();
	
	fBrowserHasContent= content != null && content.length() > 0;
	
	if (!fBrowserHasContent)		content= "<html><body ></html>";
	
	boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
	boolean resizable= isResizable();
	
	// The default "overflow:auto" would not result in a predictable width for the
	// client area and the re-wrapping would cause visual noise
	String[] styles= null;
	if (RTL && resizable) {
		styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" };
	} else if (RTL && !resizable) {
		styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" };
	} else if (!resizable) {
		// XXX: In IE, "word-wrap: break-word;" causes bogus wrapping even in non-broken
		// words :-(see e.g. Javadoc of String). Re-check whether we really still need
		// this now that the Javadoc Hover header already sets this style.
		styles= new String[] { "overflow:hidden;"/*, "word-wrap: break-word;"*/ };
	} else {
		styles= new String[] { "overflow:scroll;" };
	}
	
	StringBuffer buffer= new StringBuffer(content);
	eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionHTMLPrinter.insertStyles(buffer, styles);
	content= buffer.toString();
	
	// XXX: Should add some JavaScript here that shows something like "(continued...)"
	// or "..." at the end of the visible area when the page overflowed with
	// "overflow:hidden;".
	
	fCompleted= false;
	fBrowser.setText(content);
	
	Object[] listeners= fInputChangeListeners.getListeners();
	for (int i= 0; i < listeners.length; i++) {
		((IInputChangedListener)listeners[i]).inputChanged(fInput);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HyexpressionBrowserInformationControl.java

示例13: setInput

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * {@inheritDoc} This control can handle {@link String}(no handle) and
 */
public void setInput(Object input) {
	Assert.isLegal(input == null || input instanceof String || input instanceof eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput);
	
	if (input instanceof String) {
		setInformation((String)input);
		return;
	}
	
	fInput= (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) input;
	
	String content= null;
	if (fInput != null)		content= fInput.getHtml();
	
	fBrowserHasContent= content != null && content.length() > 0;
	
	if (!fBrowserHasContent)		content= "<html><body ></html>";
	
	boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
	boolean resizable= isResizable();
	
	// The default "overflow:auto" would not result in a predictable width for the
	// client area and the re-wrapping would cause visual noise
	String[] styles= null;
	if (RTL && resizable) {
		styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" };
	} else if (RTL && !resizable) {
		styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" };
	} else if (!resizable) {
		// XXX: In IE, "word-wrap: break-word;" causes bogus wrapping even in non-broken
		// words :-(see e.g. Javadoc of String). Re-check whether we really still need
		// this now that the Javadoc Hover header already sets this style.
		styles= new String[] { "overflow:hidden;"/*, "word-wrap: break-word;"*/ };
	} else {
		styles= new String[] { "overflow:scroll;" };
	}
	
	StringBuffer buffer= new StringBuffer(content);
	eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaHTMLPrinter.insertStyles(buffer, styles);
	content= buffer.toString();
	
	// XXX: Should add some JavaScript here that shows something like "(continued...)"
	// or "..." at the end of the visible area when the page overflowed with
	// "overflow:hidden;".
	
	fCompleted= false;
	fBrowser.setText(content);
	
	Object[] listeners= fInputChangeListeners.getListeners();
	for (int i= 0; i < listeners.length; i++) {
		((IInputChangedListener)listeners[i]).inputChanged(fInput);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HyvalidityformulaBrowserInformationControl.java

示例14: setInput

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * {@inheritDoc} This control can handle {@link String}(no handle) and
 */
public void setInput(Object input) {
	Assert.isLegal(input == null || input instanceof String || input instanceof eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput);
	
	if (input instanceof String) {
		setInformation((String)input);
		return;
	}
	
	fInput= (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput) input;
	
	String content= null;
	if (fInput != null)		content= fInput.getHtml();
	
	fBrowserHasContent= content != null && content.length() > 0;
	
	if (!fBrowserHasContent)		content= "<html><body ></html>";
	
	boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
	boolean resizable= isResizable();
	
	// The default "overflow:auto" would not result in a predictable width for the
	// client area and the re-wrapping would cause visual noise
	String[] styles= null;
	if (RTL && resizable) {
		styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" };
	} else if (RTL && !resizable) {
		styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" };
	} else if (!resizable) {
		// XXX: In IE, "word-wrap: break-word;" causes bogus wrapping even in non-broken
		// words :-(see e.g. Javadoc of String). Re-check whether we really still need
		// this now that the Javadoc Hover header already sets this style.
		styles= new String[] { "overflow:hidden;"/*, "word-wrap: break-word;"*/ };
	} else {
		styles= new String[] { "overflow:scroll;" };
	}
	
	StringBuffer buffer= new StringBuffer(content);
	eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueHTMLPrinter.insertStyles(buffer, styles);
	content= buffer.toString();
	
	// XXX: Should add some JavaScript here that shows something like "(continued...)"
	// or "..." at the end of the visible area when the page overflowed with
	// "overflow:hidden;".
	
	fCompleted= false;
	fBrowser.setText(content);
	
	Object[] listeners= fInputChangeListeners.getListeners();
	for (int i= 0; i < listeners.length; i++) {
		((IInputChangedListener)listeners[i]).inputChanged(fInput);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HydatavalueBrowserInformationControl.java

示例15: setInput

import org.eclipse.core.runtime.Assert; //导入方法依赖的package包/类
/**
 * {@inheritDoc} This control can handle {@link String}(no handle) and
 */
public void setInput(Object input) {
	Assert.isLegal(input == null || input instanceof String || input instanceof eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput);
	
	if (input instanceof String) {
		setInformation((String)input);
		return;
	}
	
	fInput= (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput) input;
	
	String content= null;
	if (fInput != null)		content= fInput.getHtml();
	
	fBrowserHasContent= content != null && content.length() > 0;
	
	if (!fBrowserHasContent)		content= "<html><body ></html>";
	
	boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
	boolean resizable= isResizable();
	
	// The default "overflow:auto" would not result in a predictable width for the
	// client area and the re-wrapping would cause visual noise
	String[] styles= null;
	if (RTL && resizable) {
		styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" };
	} else if (RTL && !resizable) {
		styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" };
	} else if (!resizable) {
		// XXX: In IE, "word-wrap: break-word;" causes bogus wrapping even in non-broken
		// words :-(see e.g. Javadoc of String). Re-check whether we really still need
		// this now that the Javadoc Hover header already sets this style.
		styles= new String[] { "overflow:hidden;"/*, "word-wrap: break-word;"*/ };
	} else {
		styles= new String[] { "overflow:scroll;" };
	}
	
	StringBuffer buffer= new StringBuffer(content);
	eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingHTMLPrinter.insertStyles(buffer, styles);
	content= buffer.toString();
	
	// XXX: Should add some JavaScript here that shows something like "(continued...)"
	// or "..." at the end of the visible area when the page overflowed with
	// "overflow:hidden;".
	
	fCompleted= false;
	fBrowser.setText(content);
	
	Object[] listeners= fInputChangeListeners.getListeners();
	for (int i= 0; i < listeners.length; i++) {
		((IInputChangedListener)listeners[i]).inputChanged(fInput);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HymappingBrowserInformationControl.java


注:本文中的org.eclipse.core.runtime.Assert.isLegal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。