Bug 382625 - [Perspectives] Setting org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS=myPerspectiveId1,myPerspectiveId2 in plugin_customization.ini
Summary: [Perspectives] Setting org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS=myPerspectiveId1...
Status: CLOSED DUPLICATE of bug 479126
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows XP
: P3 normal with 7 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: candidate43
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2012-06-14 09:15 EDT by drew frantz CLA
Modified: 2017-12-20 04:05 EST (History)
13 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description drew frantz CLA 2012-06-14 09:15:49 EDT
Setting org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS=myPerspectiveId1,myPerspectiveId2 in plugin_customization.ini has no affect in Juno RC3.
Comment 1 Simon Bernard CLA 2012-07-03 05:43:33 EDT
Hi,
 We plan to migrate to eclipse 4.2 for our product.
 Does a workaround exist for this bug ?
 Any chance to see this bug fixed in a 4.2.1 version ?
thx
Comment 2 Paul Webster CLA 2012-07-03 07:19:56 EDT
I don't have anybody to look at this, but I'd consider a safe patch for 4.2.1.

http://wiki.eclipse.org/Platform_UI/How_to_Contribute

PW
Comment 3 B Richard CLA 2013-03-18 05:40:54 EDT
Any ETA on a fix? The issue here is that the preferenceCustomization option is ignored, or at least the referenced file is not opened/used, since any option written in the file is ignored (whereas everything works fine on Juno).

It's quite problematic for RCP application and plugin development.

Thanks.
Comment 4 Paul Webster CLA 2013-03-18 06:42:41 EDT
(In reply to comment #3)
> Any ETA on a fix?

No, as mentioned I don't have anybody to look at this but will accept a patch.

PW
Comment 5 Ben H CLA 2013-03-21 11:49:25 EDT
I think something is messed up in the IPageLayout, because even if try to read out the customization myself and process it in my PerspectiveFactory the shortcut is not added to the perspective-shortcut-bar, whereas the defaultPerspectiveId-option works as a charm.

@Override
public void createInitialLayout(final IPageLayout layout) {
    /* ... my other stuff ... */
    String st = PlatformUI.getPreferenceStore().getDefaultString(
        IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS);
    for (String s : st.split(",")) {
	layout.addPerspectiveShortcut(s);
    }
}

best regards
Ben
Comment 6 Qiangsheng Wang CLA 2013-11-13 18:55:18 EST
At the moment I put the following code into the ApplicationWorkbenchWindowAdvisor:postWindowOpen method as the work around. 
And I'll try to find the time to create a patch it looks ok.


EModelService modelService = (EMod:elService) PlatformUI.getWorkbench().getService(EModelService.class);
MWindow model = ((WorkbenchWindow) window).getModel();
List<MPerspectiveStack> theStack = modelService.findElements(model, null,
				MPerspectiveStack.class, null);
MPerspectiveStack _perspectiveStack=null;
if (theStack.size() > 0) {
	_perspectiveStack = theStack.get(0);
}
		
IPerspectiveDescriptor perspect = PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(SimulationPerspective.ID);
		
		
MPerspective pers = MAdvancedFactory.INSTANCE.createPerspective();
		
pers.setLabel(perspect.getLabel());
pers.setElementId(perspect.getId());

EPartService partService = (EPartService) window.getService(EPartService.class);
		
IPerspectiveFactory factory = ((PerspectiveDescriptor) perspect).createFactory();
ModeledPageLayout modelLayout = new ModeledPageLayout(model, modelService,
				partService, pers, perspect, (WorkbenchPage) window.getActivePage(), true);
		factory.createInitialLayout(modelLayout);

if(_perspectiveStack!=null)
   _perspectiveStack.getChildren().add(pers);
Comment 7 Martin Schreiber CLA 2014-11-18 02:17:50 EST
Submitted a patch for review: https://git.eclipse.org/r/#/c/34708/
Comment 8 John Moule CLA 2017-02-21 10:15:07 EST
Possibly a duplicate of the resolved Bug 479126 - PERSPECTIVE_BAR_EXTRAS setting not taken into account
Comment 9 Lars Vogel CLA 2017-12-20 04:05:50 EST
(In reply to John Moule from comment #8)
> Possibly a duplicate of the resolved Bug 479126 - PERSPECTIVE_BAR_EXTRAS
> setting not taken into account

Thanks.

*** This bug has been marked as a duplicate of bug 479126 ***