本文整理汇总了Java中org.eclipse.swt.graphics.Resource类的典型用法代码示例。如果您正苦于以下问题:Java Resource类的具体用法?Java Resource怎么用?Java Resource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Resource类属于org.eclipse.swt.graphics包,在下文中一共展示了Resource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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;
}
示例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();
}
示例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();
}
}
}
示例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();
}
示例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]);
}
}
}
示例7: disposeAll
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public void disposeAll() {
for (Resource resource : list) {
if (!resource.isDisposed()) {
resource.dispose();
}
}
list.clear();
}
示例8: widgetDisposed
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public void widgetDisposed(DisposeEvent e) {
for(Resource rs: m_resources) {
if(!rs.isDisposed()) {
rs.dispose();
}
}
}
示例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();
}
示例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;
}
示例12: ResourceManager
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public ResourceManager() {
this.list = new ArrayList<Resource>();
}
示例13: add
import org.eclipse.swt.graphics.Resource; //导入依赖的package包/类
public void add(Resource resource) {
list.add(resource);
}
示例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;
}
}
示例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();
}
}