Java 类org.eclipse.swt.graphics.Resource 实例源码

项目:xtext-gef    文件:TextPropertiesViewPart.java   
@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();
}
项目:show-shortcuts    文件:ShortcutPopup.java   
@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;
}
项目:Mailster    文件:SWTHelper.java   
/**
 * 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();
}
项目:n4js    文件:TestProgressBar.java   
private void dispose(final Resource... rs) {
    for (final Resource r : rs) {
        if (null != r && !r.isDisposed()) {
            r.dispose();
        }
    }
}
项目:ccu-historian    文件:SWTGraphics2D.java   
/**
 * 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();
}
项目:aya-lang    文件:SWTGraphics2D.java   
/**
 * 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();
}
项目:TuxGuitar-1.3.1-fork    文件:TGMatrixConfig.java   
protected void dispose(Resource[] resources){
    if(resources != null){
        for(int i = 0; i < resources.length; i ++){
            dispose(resources[i]);
        }
    }
}
项目:TuxGuitar-1.3.1-fork    文件:TGMatrixEditor.java   
protected void dispose(Resource[] resources){
    if(resources != null){
        for(int i = 0; i < resources.length; i ++){
            dispose(resources[i]);
        }
    }
}
项目:EasySnap    文件:ResourceManager.java   
public void disposeAll() {
    for (Resource resource : list) {
        if (!resource.isDisposed()) {
            resource.dispose();
        }
    }
    list.clear();
}
项目:ECG-Viewer    文件:SWTGraphics2D.java   
/**
 * 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();
}
项目:astor    文件:SWTGraphics2D.java   
/**
 * 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();
}
项目:DroidNavi    文件:EventWindow.java   
public void widgetDisposed(DisposeEvent e) {
    for(Resource rs: m_resources) {
        if(!rs.isDisposed()) {
            rs.dispose();
        }
    }
}
项目:group-five    文件:SWTGraphics2D.java   
/**
 * 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();
}
项目:NIEM-Modeling-Tool    文件:ReferenceLibraryClassifierNameDialog.java   
private void dispose(final Resource... resources) {
    for (final Resource r : resources) {
        if (r != null) {
            r.dispose();
        }
    }
}
项目:totallicks-tuxguitar    文件:MatrixConfig.java   
protected void dispose(Resource[] resources){
    if(resources != null){
        for(int i = 0; i < resources.length; i ++){
            dispose(resources[i]);
        }
    }
}
项目:totallicks-tuxguitar    文件:MatrixEditor.java   
protected void dispose(Resource[] resources){
    if(resources != null){
        for(int i = 0; i < resources.length; i ++){
            dispose(resources[i]);
        }
    }
}
项目:totallicks-tuxguitar    文件:TGResources.java   
public void dispose(){
    Iterator it = this.resources.iterator();
    while( it.hasNext() ){
        Resource resource = (Resource)it.next();
        resource.dispose();
    }
    this.resources.clear();
}
项目:totallicks-tuxguitar    文件:IconManager.java   
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;
}
项目:buffer_bci    文件:SWTGraphics2D.java   
/**
 * 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();
}
项目:proyecto-teoria-control-utn-frro    文件:SWTGraphics2D.java   
/**
 * 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();
}
项目:Memetic-Algorithm-for-TSP    文件:SWTGraphics2D.java   
/**
 * 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();
}
项目:TuxGuitar-1.3.1-fork    文件:TGMatrixConfig.java   
protected void dispose(Resource resource){
    if(resource != null){
        resource.dispose();
    }
}
项目:TuxGuitar-1.3.1-fork    文件:TGMatrixEditor.java   
protected void dispose(Resource resource){
    if(resource != null){
        resource.dispose();
    }
}
项目:EasySnap    文件:ResourceManager.java   
public ResourceManager() {
    this.list = new ArrayList<Resource>();
}
项目:EasySnap    文件:ResourceManager.java   
public void add(Resource resource) {
    list.add(resource);
}
项目:xtext-gef    文件:TextPropertiesViewPart.java   
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;
  }
}
项目:swtrangeslider    文件:RangeSlider.java   
/**
 * Dispose safely any SWT resource
 * 
 * @param resource the resource to dispose
 */
private void safeDispose(final Resource resource) {
    if (resource != null && !resource.isDisposed()) {
        resource.dispose();
    }
}
项目:mytourbook    文件:Map.java   
private void disposeResource(final Resource resource) {
    if ((resource != null) && !resource.isDisposed()) {
        resource.dispose();
    }
}
项目:mytourbook    文件:Util.java   
public static Resource disposeResource(final Resource resource) {
    if (resource != null && !resource.isDisposed()) {
        resource.dispose();
    }
    return null;
}
项目:mytourbook    文件:Map.java   
private void disposeResource(final Resource resource) {
    if ((resource != null) && !resource.isDisposed()) {
        resource.dispose();
    }
}
项目:DroidNavi    文件:EventWindow.java   
public void registerResource(Resource rs) {
    if(rs == null) { throw new NullPointerException("Resource cannot be null."); }
    m_resources.add(rs);
}
项目:totallicks-tuxguitar    文件:MatrixConfig.java   
protected void dispose(Resource resource){
    if(resource != null){
        resource.dispose();
    }
}
项目:totallicks-tuxguitar    文件:MatrixEditor.java   
protected void dispose(Resource resource){
    if(resource != null){
        resource.dispose();
    }
}
项目:goclipse    文件:SWTUtil.java   
public static <T extends Resource> T dispose(T resource) {
    if(resource != null) {
        resource.dispose();
    }
    return null;
}
项目:n4js    文件:UIUtils.java   
/**
 * 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();
    }
}
项目:ccu-historian    文件:SWTGraphics2D.java   
/**
 * Add given swt resource to the resource pool. All resources added
 * to the resource pool will be disposed when {@link #dispose()} is called.
 *
 * @param resource the resource to add to the pool.
 * @return the swt <code>Resource</code> just added.
 */
private Resource addToResourcePool(Resource resource) {
    this.resourcePool.add(resource);
    return resource;
}
项目:aya-lang    文件:SWTGraphics2D.java   
/**
 * Add given swt resource to the resource pool. All resources added
 * to the resource pool will be disposed when {@link #dispose()} is called.
 *
 * @param resource the resource to add to the pool.
 * @return the swt <code>Resource</code> just added.
 */
private Resource addToResourcePool(Resource resource) {
    this.resourcePool.add(resource);
    return resource;
}
项目:ECG-Viewer    文件:SWTGraphics2D.java   
/**
 * Add given swt resource to the resource pool. All resources added
 * to the resource pool will be disposed when {@link #dispose()} is called.
 *
 * @param resource the resource to add to the pool.
 * @return the swt <code>Resource</code> just added.
 */
private Resource addToResourcePool(Resource resource) {
    this.resourcePool.add(resource);
    return resource;
}
项目:astor    文件:SWTGraphics2D.java   
/**
 * Add given swt resource to the resource pool. All resources added
 * to the resource pool will be disposed when {@link #dispose()} is called.
 *
 * @param resource the resource to add to the pool.
 * @return the swt <code>Resource</code> just added.
 */
private Resource addToResourcePool(Resource resource) {
    this.resourcePool.add(resource);
    return resource;
}
项目:group-five    文件:SWTGraphics2D.java   
/**
 * Add given swt resource to the resource pool. All resources added
 * to the resource pool will be disposed when {@link #dispose()} is called.
 *
 * @param resource the resource to add to the pool.
 * @return the swt <code>Resource</code> just added.
 */
private Resource addToResourcePool(Resource resource) {
    this.resourcePool.add(resource);
    return resource;
}