Ignore:
Timestamp:
01/18/06 11:01:31 (19 years ago)
Author:
boris
Message:
  • fixed problem with images that fail to be loaded
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/Plugin.java

    r244 r254  
    11package org.modelica.mdt.ui;
    22
     3import org.eclipse.swt.widgets.Display;
    34import org.eclipse.ui.plugin.*;
    45import org.eclipse.core.runtime.IAdapterFactory;
     
    5051        return plugin;
    5152    }
    52 
    53 //  /**
    54 //   * Returns an image descriptor for the image file at the given
    55 //   * plug-in relative path.
    56 //   *
    57 //   * @param path the path
    58 //   * @return the image descriptor
    59 //   */
    60 //  public static ImageDescriptor getImageDescriptor(String path)
    61 //  {
    62 //      return AbstractUIPlugin.imageDescriptorFromPlugin("org.modelica.mdt.ui", path);
    63 //  }
     53   
     54    /**
     55     * Returns the standard display to be used. The method first checks, if
     56     * the thread calling this method has an associated display. If so, this
     57     * display is returned. Otherwise the method returns the default display.
     58     */
     59    public static Display getStandardDisplay()
     60    {
     61        Display display;
     62        display = Display.getCurrent();
     63        if (display == null)
     64            display = Display.getDefault();
     65        return display;     
     66    }
    6467}
Note: See TracChangeset for help on using the changeset viewer.