Package org.eclipse.ui

Examples of org.eclipse.ui.ISharedImages


            public void dispose()
            {
            }
        };
       
        final ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
       
        final ILabelProvider labelProvider = new ILabelProvider()
        {
            private Image errorImage;
            private Image warningImage;
           
            public String getText( final Object element )
            {
                return ( (Status) element ).message();
            }

            public Image getImage( final Object element )
            {
                if( ( (Status) element ).severity() == Status.Severity.ERROR )
                {
                    return getErrorImage();
                }
                else
                {
                    return getWarningImage();
                }
            }
           
            private Image getErrorImage()
            {
                if( this.errorImage == null )
                {
                    this.errorImage = SwtUtil.createImageDescriptor( SwtResourceCache.class, "Error.png" ).createImage();
                }
               
                return this.errorImage;
            }
           
            private Image getWarningImage()
            {
                if( this.warningImage == null )
                {
                    this.warningImage = SwtUtil.createImageDescriptor( SwtResourceCache.class, "Warning.png" ).createImage();
                }
               
                return this.warningImage;
            }

            public void addListener( final ILabelProviderListener listener )
            {
            }

            public void removeListener( final ILabelProviderListener listener )
            {
            }
           
            public boolean isLabelProperty( final Object element,
                                            final String property )
            {
                return false;
            }

            public void dispose()
            {
                if( this.errorImage != null )
                {
                    this.errorImage.dispose();
                }
               
                if( this.warningImage != null )
                {
                    this.warningImage.dispose();
                }
            }
        };
       
        this.treeViewer.setContentProvider( contentProvider );
        this.treeViewer.setLabelProvider( labelProvider );
        this.treeViewer.setInput( this );
       
        final Menu menu = new Menu( this.tree );
        this.tree.setMenu( menu );
       
        final MenuItem copyMenuItem = new MenuItem( menu, SWT.PUSH );
        copyMenuItem.setText( copyMenuItemLabel.text() );
        copyMenuItem.setImage( sharedImages.getImage( ISharedImages.IMG_TOOL_COPY ) );
       
        copyMenuItem.addSelectionListener
        (
            new SelectionAdapter()
            {
View Full Code Here


    undoAction.update();
    redoAction.update();
  }
 
  protected void initActions(IActionBars actionBars) {
      ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();

      undoAction = new UndoAction(editingDomain);
      undoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
      actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);

      redoAction = new RedoAction(editingDomain);
      redoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
      actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
   
      actionBars.updateActionBars();
  }
View Full Code Here

        ICommonViewerSite viewSite = aSite.getViewSite();
        if (viewSite instanceof ICommonViewerWorkbenchSite) {
            ICommonViewerWorkbenchSite site = (ICommonViewerWorkbenchSite) viewSite;
            Shell shell = site.getShell();

            ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
            clipboard = new Clipboard(shell.getDisplay());
            selectionProvider = site.getSelectionProvider();
            openPythonAction = new PyOpenPythonFileAction(site.getPage(), selectionProvider);
            openResourceAction = new PyOpenResourceAction(site.getPage(), selectionProvider);
            openExternalAction = new PyOpenExternalAction(site.getPage(), selectionProvider);

            deleteResourceAction = new PyDeleteResourceAction(shell, selectionProvider);
            copyResourceAction = new PyCopyResourceAction(shell, selectionProvider, clipboard);
            pasteAction = new PyPasteAction(shell, selectionProvider, clipboard);
            moveResourceAction = new PyMoveResourceAction(shell, selectionProvider);

            copyResourceAction.setDisabledImageDescriptor(images
                    .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
            copyResourceAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));

            pasteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
            pasteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));

            deleteResourceAction.setDisabledImageDescriptor(images
                    .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
            deleteResourceAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));

        }
    }
View Full Code Here

    private final BrowserInformationControl fInfoControl;

    public ForwardAction(BrowserInformationControl infoControl) {
      fInfoControl = infoControl;
      setText(PHPHoverMessages.JavadocHover_forward);
      ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
      setImageDescriptor(images
          .getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
      setDisabledImageDescriptor(images
          .getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));

      update();
    }
View Full Code Here

    super(IDEWorkbenchMessages.NewProjectAction_text);
    if (window == null) {
      throw new IllegalArgumentException();
    }
    this.window = window;
    ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
    setImageDescriptor(images
        .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD));
    setDisabledImageDescriptor(images
        .getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_DISABLED));
    setToolTipText(IDEWorkbenchMessages.NewProjectAction_toolTip);
    PlatformUI
        .getWorkbench()
        .getHelpSystem()
View Full Code Here

    private final BrowserInformationControl fInfoControl;

    public BackAction(BrowserInformationControl infoControl) {
      fInfoControl = infoControl;
      setText(PHPHoverMessages.JavadocHover_back);
      ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
      setImageDescriptor(images
          .getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
      setDisabledImageDescriptor(images
          .getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));

      update();
    }
View Full Code Here

  public DeleteAction(IWorkbenchSite site) {
    super(site);
    setText(ReorgMessages.DeleteAction_3);
    setDescription(ReorgMessages.DeleteAction_4);
    ISharedImages workbenchImages = DLTKUIPlugin.getDefault()
        .getWorkbench().getSharedImages();
    setDisabledImageDescriptor(workbenchImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
    setImageDescriptor(workbenchImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
    setHoverImageDescriptor(workbenchImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));

    if (DLTKCore.DEBUG) {
      System.err.println(Messages.DeleteAction_0);
    }
View Full Code Here

*
*/
public class CustomObjectTypeNode extends PackageTreeNode {
    public CustomObjectTypeNode(String name) {
        super(name);
        ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
        image = sharedImages.getImage(ISharedImages.IMG_OBJ_FILE);
    }
View Full Code Here

*
*/
public class ComponentFolderNode extends PackageTreeNode {
    public ComponentFolderNode(String name) {
        super(name);
        ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
        image = sharedImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
    }
View Full Code Here

*
*/
public class ComponentNode extends PackageTreeNode {
    public ComponentNode(String name) {
        super(name);
        ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
        image = sharedImages.getImage(ISharedImages.IMG_OBJ_FILE);
        retrieved = true;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.ISharedImages

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.