Schlagwort: Eclipse

RCP: Remove unwanted preference pages

In my RCP application some unwanted sections in the preferences showed up: How to get rid of them? Thats easy, in the "ApplicationWorkbenchAdvisor" class, override the "postStartup" method: @Override public void postStartup(){ PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager(); pm.remove("org.eclipse.help.ui.browsersPreferencePage"); //$NON-NLS-1$ pm.remove("org.eclipse.help.ui.contentPreferencePage"); //$NON-NLS-1$ } What if you don’t know the id of the preference page? No problem, you …

weiterlesen »

RCP: Perspectives and Perspective Contributions

Note: I put the example project in a ZIP file, you can use that to have a look to the actual code, Download. Start In the first step, we create a sample plugin project (Mail project): Make the perspective bar visible This needs to be done in the ApplicationWorkbenchWindowAdvisor.java class, in the preWindowOpen method: IWorkbenchWindowConfigurer …

weiterlesen »

Color Themes for Eclipse

When it comes to programming I like dark backgrounds in the editor. Setting the colors in Eclipse is a lot of work and the settings only apply for a certain workspace. If you create another workspace, all is set to default colors. But there is a simple solution: Eclipse color theme After installing the plugin …

weiterlesen »

Java: Check if your code is running in Eclipse

Sometimes, for example during debugging, it is useful to check if your code is running from the Eclipse IDE to exclude certain code from execution. How can this be done? Here is an example: public class mainClass { public static void main(String[] args) { String inEclipse = System.getProperty("ineclipse"); if ((inEclipse == null) || (!inEclipse.equals("true"))) { …

weiterlesen »

RCP Application Set Title of Application Window

To dynamically set the title of a RCP application, the following code snippet is useful: private String fileName = "unknown.daf"; public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { IWorkbenchWindowConfigurer windowConfigurer = configurer; String title = "DA-FormMaker – " + fileName; windowConfigurer.setTitle(title); return new ApplicationWorkbenchWindowAdvisor(configurer); } The window title can be set via the “_IWorkbenchWindowConfigurer”. You can get a …

weiterlesen »