本文整理汇总了Java中org.eclipse.swt.graphics.Resource类的典型用法代码示例。如果您正苦于以下问题:Java Resource类的具体用法?Java Resource怎么用?Java Resource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Resource类属于org.eclipse.swt.graphics包,在下文中一共展示了Resource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: dispose
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
@Override
public void dispose() {
if (this.selectionListener!=null) {
this.selectionListener.dispose();
}
final Procedure1<Resource> _function = new Procedure1<Resource>() {
@Override
public void apply(final Resource it) {
it.dispose();
}
};
IterableExtensions.<Resource>forEach(this.swtResources, _function);
this.swtResources.clear();
this.executorService.shutdown();
super.dispose();
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:17,代码来源:TextPropertiesViewPart.java
示例2: close
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
@Override
public boolean close() {
// If already closed, there is nothing to do.
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127505
Shell shell = getShell();
if (shell != null && !shell.isDisposed()) {
saveDialogBounds(shell);
}
boolean closed = super.close();
for (Resource resource : this.resources) {
resource.dispose();
}
this.resources.clear();
return closed;
}
开发者ID:chgeo,项目名称:show-shortcuts,代码行数:19,代码来源:ShortcutPopup.java
示例3: disposeAll
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
/**
* Dispose all registered OS resources.
*/
public static void disposeAll()
{
if (imageToDecoratorMap != null)
{
Iterator<HashMap<Image, Image>> baseImages = imageToDecoratorMap.values().iterator();
while (baseImages.hasNext())
{
Iterator<Image> decorators = baseImages.next().values().iterator();
while (decorators.hasNext())
decorators.next().dispose();
}
}
Iterator<Resource> it = resourceTracker.values().iterator();
while (it.hasNext())
it.next().dispose();
}
开发者ID:edeoliveira,项目名称:Mailster,代码行数:21,代码来源:SWTHelper.java
示例4: dispose
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
private void dispose(final Resource... rs) {
for (final Resource r : rs) {
if (null != r && !r.isDisposed()) {
r.dispose();
}
}
}
开发者ID:eclipse,项目名称:n4js,代码行数:8,代码来源:TestProgressBar.java
示例5: disposeResourcePool
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
/**
* Dispose the resource pool.
*/
private void disposeResourcePool() {
for (Iterator it = this.resourcePool.iterator(); it.hasNext();) {
Resource resource = (Resource) it.next();
resource.dispose();
}
this.fontsPool.clear();
this.colorsPool.clear();
this.transformsPool.clear();
this.resourcePool.clear();
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:SWTGraphics2D.java
示例6: dispose
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
protected void dispose(Resource[] resources){
if(resources != null){
for(int i = 0; i < resources.length; i ++){
dispose(resources[i]);
}
}
}
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:8,代码来源:TGMatrixConfig.java
示例7: disposeAll
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public void disposeAll() {
for (Resource resource : list) {
if (!resource.isDisposed()) {
resource.dispose();
}
}
list.clear();
}
开发者ID:kamil-karkus,项目名称:EasySnap,代码行数:9,代码来源:ResourceManager.java
示例8: widgetDisposed
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public void widgetDisposed(DisposeEvent e) {
for(Resource rs: m_resources) {
if(!rs.isDisposed()) {
rs.dispose();
}
}
}
开发者ID:Kenishi,项目名称:DroidNavi,代码行数:8,代码来源:EventWindow.java
示例9: dispose
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
private void dispose(final Resource... resources) {
for (final Resource r : resources) {
if (r != null) {
r.dispose();
}
}
}
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:8,代码来源:ReferenceLibraryClassifierNameDialog.java
示例10: dispose
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public void dispose(){
Iterator it = this.resources.iterator();
while( it.hasNext() ){
Resource resource = (Resource)it.next();
resource.dispose();
}
this.resources.clear();
}
开发者ID:Totallicks,项目名称:totallicks-tuxguitar,代码行数:9,代码来源:TGResources.java
示例11: purgeDisposableIcons
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
private List purgeDisposableIcons(){
List disposableIcons = new ArrayList();
Iterator it = this.disposableIcons.iterator();
while( it.hasNext() ){
Resource resource = (Resource)it.next();
disposableIcons.add( resource );
}
this.disposableIcons.clear();
return disposableIcons;
}
开发者ID:Totallicks,项目名称:totallicks-tuxguitar,代码行数:11,代码来源:IconManager.java
示例12: ResourceManager
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public ResourceManager() {
this.list = new ArrayList<Resource>();
}
开发者ID:kamil-karkus,项目名称:EasySnap,代码行数:4,代码来源:ResourceManager.java
示例13: add
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public void add(Resource resource) {
list.add(resource);
}
开发者ID:kamil-karkus,项目名称:EasySnap,代码行数:4,代码来源:ResourceManager.java
示例14: refresh
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
protected void refresh(final EObject object, final Notification notification) {
boolean _or = false;
if (this.refreshing) {
_or = true;
} else {
_or = this.mergingBack;
}
if (_or) {
return;
}
this.refreshing = true;
try {
if (((object == this.currentViewedObject) && (notification != null))) {
final EObject mergeResult = this.mergeForward(object, notification);
if ((mergeResult != null)) {
org.eclipse.emf.ecore.resource.Resource _eResource = mergeResult.eResource();
final String uriFragment = _eResource.getURIFragment(mergeResult);
EObject _eContainer = mergeResult.eContainer();
SaveOptions.Builder _newBuilder = SaveOptions.newBuilder();
SaveOptions.Builder _format = _newBuilder.format();
SaveOptions _options = _format.getOptions();
final String serializedModel = this.serializer.serialize(_eContainer, _options);
this.modelAccess.updateModel(serializedModel, uriFragment);
String _editablePart = this.modelAccess.getEditablePart();
this.lastMergedContent = _editablePart;
return;
}
}
if ((this.currentViewedObject != null)) {
final String content = this.modelAccess.getEditablePart();
boolean _notEquals = (!Objects.equal(content, this.lastMergedContent));
if (_notEquals) {
EObject mergeSource = null;
boolean _and = false;
if (!(object != this.currentViewedObject)) {
_and = false;
} else {
boolean _isEmpty = this.validationErrors.isEmpty();
_and = _isEmpty;
}
if (_and) {
EObject _mergeBack = this.mergeBack(this.currentViewedObject, this.editingDomain);
mergeSource = _mergeBack;
}
if ((mergeSource == null)) {
this.handleDiscardedChanges();
}
}
}
this.resourceValidator.setOriginalObject(object);
if ((object == null)) {
this.lastMergedContent = "";
this.modelAccess.updateModel(this.lastMergedContent);
} else {
org.eclipse.emf.ecore.resource.Resource _eResource_1 = object.eResource();
final String uriFragment_1 = _eResource_1.getURIFragment(object);
EObject _eContainer_1 = object.eContainer();
SaveOptions.Builder _newBuilder_1 = SaveOptions.newBuilder();
SaveOptions.Builder _format_1 = _newBuilder_1.format();
SaveOptions _options_1 = _format_1.getOptions();
final String serializedModel_1 = this.serializer.serialize(_eContainer_1, _options_1);
this.modelAccess.updateModel(serializedModel_1, uriFragment_1);
this.viewer.setSelectedRange(0, 0);
String _editablePart_1 = this.modelAccess.getEditablePart();
this.lastMergedContent = _editablePart_1;
}
this.currentViewedObject = object;
} finally {
this.refreshing = false;
}
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:72,代码来源:TextPropertiesViewPart.java
示例15: safeDispose
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
/**
* Dispose safely any SWT resource
*
* @param resource the resource to dispose
*/
private void safeDispose(final Resource resource) {
if (resource != null && !resource.isDisposed()) {
resource.dispose();
}
}
开发者ID:prasser,项目名称:swtrangeslider,代码行数:11,代码来源:RangeSlider.java
示例16: disposeResource
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
private void disposeResource(final Resource resource) {
if ((resource != null) && !resource.isDisposed()) {
resource.dispose();
}
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:6,代码来源:Map.java
示例17: disposeResource
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public static Resource disposeResource(final Resource resource) {
if (resource != null && !resource.isDisposed()) {
resource.dispose();
}
return null;
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:7,代码来源:Util.java
示例18: registerResource
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public void registerResource(Resource rs) {
if(rs == null) { throw new NullPointerException("Resource cannot be null."); }
m_resources.add(rs);
}
开发者ID:Kenishi,项目名称:DroidNavi,代码行数:5,代码来源:EventWindow.java
示例19: dispose
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public static <T extends Resource> T dispose(T resource) {
if(resource != null) {
resource.dispose();
}
return null;
}
开发者ID:GoClipse,项目名称:goclipse,代码行数:7,代码来源:SWTUtil.java
示例20: dispose
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
/**
* Disposes the resource argument. Has no effect if the resource argument is either {@code null} or already
* {@link Resource#isDisposed() disposed}.
*
* @param resource
* the resource to dispose. Optional, can be {@code null}.
*/
public static void dispose(final Resource resource) {
if (null != resource && !resource.isDisposed()) {
resource.dispose();
}
}
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:UIUtils.java
注:本文中的org.eclipse.swt.graphics.Resource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论