che icon indicating copy to clipboard operation
che copied to clipboard

How to add an icon on right navigation bar.

Open mstavares opened this issue 8 years ago • 2 comments

Description

Hi,

I'm trying to develop a plugin which uses the right navigation bar (I don't know if this is the correct name). I would like to set an icon like git.

file

How could I add an icon here?

Thanks,

mstavares avatar Jun 27 '18 10:06 mstavares

You can create AbstractPerspectiveAction to open your part like it was done in the ProjectExplorer: https://github.com/eclipse/che/blob/master/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/actions/switching/ProjectExplorerDisplayingModeAction.java#L43

Than icon can be set: https://github.com/eclipse/che/blob/master/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/actions/switching/ProjectExplorerDisplayingModeAction.java#L59

In the GWT code you should have interface with static resources definition:

public interface Resources extends com.google.gwt.resources.client.ClientBundle {

/** icon should be copied to the resources folder, 
 /* but by path "your application fqn + path defined in the bundle interface". 
 /* For example you have fqn to the gwt source code "org.test.ide.client", 
 /* for icon above path will be:
 /* YourPluginName/src/main/resources/org/test/ide/client/mypart/startPart.svg
 /*
  @Source("mypart/starPart.svg") 
  SVGResource logo();

  // @Source({"Styles.css"})
  // Styles pluginStyles();
}

For example, https://github.com/eclipse/che/blob/master/ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/Resources.java#L174 And icon located: https://github.com/eclipse/che/blob/master/ide/che-core-ide-app/src/main/resources/org/eclipse/che/ide/part/project-explorer-part-icon.svg

AndrienkoAleksandr avatar Jun 27 '18 10:06 AndrienkoAleksandr

Hi,

Ok, thanks :+1:

mstavares avatar Jul 05 '18 16:07 mstavares