Index

Eclipse

command line arguments

starting eclipse with specified workspace
./eclipse -data "$location"
start eclipse with specified perspective
./eclipse -perspective [id]
installing jdt plugin unattended
./eclipse -noSplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/eclipse/updates/4.7 -installIUs org.eclipse.jdt.feature.group
installing multiple features at once
./eclipse -noSplash -application org.eclipse.equinox.p2.director 
	-repository "http://download.eclipse.org/eclipse/updates/4.7" -installIUs "org.eclipse.pde.feature.group, org.eclipse.cvs.feature.group"
eclipse command line argument reference
http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Frunning_eclipse.htm
eclipse log file
.metadata/.log

plugin development

getting the workspace
IWorkspace workspace = ResourcesPlugin.getWorkspace();
getting the projects in workspace
IProject[] projects = workspace.getProjects();
linking workspace to existing project
File projectDir = ...
Path path = new Path(projectDir.getAbsolutePath());
IProjectDescription description = workspace.loadProjectDescription(path);
IProject project = workspace.getRoot().getProject(description.getName());
project.create(description, null);
project.open(null);
importing preferences
IPreferencesService service = Platform.getPreferencesService();
IExportedPreferences prefs = service.readPreferences(new FileInputStream(file));
IPreferenceFilter filter = new IPreferenceFilter() {
	@Override
	public String[] getScopes() {
		return new String[] { InstanceScope.SCOPE, ConfigurationScope.SCOPE };
	}
	@Override
	public Map<String, PreferenceFilterEntry[]> getMapping(String scope) {
		return null;
	}
};
service.applyPreferences(prefs, new IPreferenceFilter[] { filter });
opening a perspective
IWorkbenchPage java = workbench.showPerspective(JAVA_PERSPECTIVE, window);
closing a view
IWorkbenchPage page = window.getActivePage();
page.hideView(page.findView(INTRO_VIEW));
page.close();
running code in a plugin before eclipse is fully started
public class StartupJobs implements org.eclipse.ui.IStartup {
	@Override
	public void earlyStartup() {
		// TODO: code goes here
	}
}
requires the following extension in plugin.xml to work
<extension point="org.eclipse.ui.startup">
      <startup class="eclipseinit.StartupJobs">
      </startup>
   </extension>

constants

perspectives
org.eclipse.debug.ui.DebugPerspective
org.eclipse.jdt.ui.JavaBrowsingPerspective
org.eclipse.jdt.ui.JavaHierarchyPerspective
org.eclipse.jdt.ui.JavaPerspective
org.eclipse.team.ui.TeamSynchronizingPerspective
org.eclipse.ui.resourcePerspective
views
org.eclipse.debug.ui.BreakpointView
org.eclipse.debug.ui.DebugView
org.eclipse.jdt.ui.JavadocView
org.eclipse.jdt.ui.SourceView
org.eclipse.ui.internal.introview
org.eclipse.ui.views.ContentOutline
org.eclipse.ui.views.TaskList