Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Plugin - how to add package explorer to a custom perspective
Plugin - how to add package explorer to a custom perspective [message #1063706] Thu, 13 June 2013 19:41 Go to next message
Kevin Regan is currently offline Kevin ReganFriend
Messages: 33
Registered: May 2013
Member
Hopefully this is a simple question to answer... I have a plugin declaring a custom perspective and I simply want to add the existing package explorer that is present in the normal Java perspective to it but I cannot figure out how to accomplish this. Specifically I'm assuming I need to add some code such as a call to IPageLayout.addView to the IPerspectiveFactory createInitialLayout function but I am not sure.

Re: Plugin - how to add package explorer to a custom perspective [message #1063840 is a reply to message #1063706] Fri, 14 June 2013 12:36 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Yes, you would use addView(*). The ID can be found at
org.eclipse.jdt.ui.JavaUI.ID_PACKAGES

Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/workbench.htm


Re: Plugin - how to add package explorer to a custom perspective [message #1063856 is a reply to message #1063840] Fri, 14 June 2013 14:17 Go to previous messageGo to next message
Kevin Regan is currently offline Kevin ReganFriend
Messages: 33
Registered: May 2013
Member
Thanks for the response but I am apparently still doing something wrong - I Looked up that ID you mentioned and believe I put the right view ID into the addView function but when I debug and open the perspective it is empty. Here is the code in my IPerspectiveFactory implementation:

public void createInitialLayout(IPageLayout layout) {
		// TODO Auto-generated method stub
		defineActions(layout);
		defineLayout(layout);

	}
	
	public void defineActions(IPageLayout layout) {
		// Add "new wizards".
        layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");
        layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");

        // Add "show views".

        layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS);
        layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
        layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
        layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
	}
	
	public void defineLayout(IPageLayout layout) {
		String editorArea = layout.getEditorArea();
		
		layout.addView("org.eclipse.jdt.ui.PackageExplorer.", IPageLayout.LEFT, (float) 0.26, editorArea);
	}


I also do not see any of the shortcuts added in the defineActions function either.

[Updated on: Fri, 14 June 2013 14:18]

Report message to a moderator

Re: Plugin - how to add package explorer to a custom perspective [message #1063867 is a reply to message #1063856] Fri, 14 June 2013 15:17 Go to previous message
Kevin Regan is currently offline Kevin ReganFriend
Messages: 33
Registered: May 2013
Member
Hi, I was able to resolve the problem by cleaning out the "eclipse Application" workspace that gets automatically generated when running the plugin from within the IDE - the package explorer is showing now along with all the other things I added to the perspective. Thanks!
Previous Topic:Turn of error message for wrong Java version (execution environment)
Next Topic:How to determine whether the resouce/file is opened by some editor
Goto Forum:
  


Current Time: Wed Feb 05 05:59:30 GMT 2025

Powered by FUDForum. Page generated in 0.03371 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top