Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 257298 Details for
Bug 479126
PERSPECTIVE_BAR_EXTRAS setting not taken into account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch which enables the setting
479126.patch (text/plain), 4.59 KB, created by
Manuel Steurer
on 2015-10-16 08:10:37 EDT
(
hide
)
Description:
Patch which enables the setting
Filename:
MIME Type:
Creator:
Manuel Steurer
Created:
2015-10-16 08:10:37 EDT
Size:
4.59 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java >index 8b33644..2624cf8 100644 >--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java >+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java >@@ -17,7 +17,9 @@ > import java.io.IOException; > import java.net.URL; > import java.util.Collections; >+import java.util.LinkedHashSet; > import java.util.List; >+import java.util.Set; > import javax.annotation.PostConstruct; > import javax.annotation.PreDestroy; > import javax.inject.Inject; >@@ -401,6 +403,40 @@ > } > } > } >+ >+ createPerspectiveBarExtras(); >+ } >+ >+ /** >+ * Add ToolItems for perspectives specified in "PERSPECTIVE_BAR_EXTRAS" >+ */ >+ private void createPerspectiveBarExtras() { >+ String persps = PrefUtil.getAPIPreferenceStore() >+ .getString(IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS); >+ String[] parts = persps.split(" "); //$NON-NLS-1$ >+ Set<String> perspSet = new LinkedHashSet<>(); >+ for (String part : parts) { >+ String[] parts2 = part.split(","); //$NON-NLS-1$ >+ for (String part2 : parts2) { >+ part2 = part2.trim(); >+ if (!part2.isEmpty()) >+ perspSet.add(part2); >+ } >+ } >+ >+ WorkbenchPage page = (WorkbenchPage) window.getContext().get(IWorkbenchPage.class); >+ for (String perspId : perspSet) { >+ MPerspective persp = (MPerspective) modelService.find(perspId, window); >+ if (persp != null) >+ continue; // already in stack, i.e. has already been added above >+ IPerspectiveDescriptor desc = getDescriptorFor(perspId); >+ if (desc == null) >+ continue; // this perspective does not exist >+ persp = page.createPerspective(desc); >+ persp.setLabel(desc.getLabel()); >+ getPerspectiveStack().getChildren().add(persp); >+ // "add" fires Event, causes creation of ToolItem on perspective bar >+ } > } > > protected Point downPos = null; >diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java >index 0c4240e..163e51e 100644 >--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java >+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java >@@ -4032,21 +4032,8 @@ > perspective.getId(), window); > > if (modelPerspective == null) { >- > // couldn't find the perspective, create a new one >- modelPerspective = modelService.createModelElement(MPerspective.class); >- >- // tag it with the same id >- modelPerspective.setElementId(perspective.getId()); >- >- // instantiate the perspective >- IPerspectiveFactory factory = ((PerspectiveDescriptor) perspective).createFactory(); >- ModeledPageLayout modelLayout = new ModeledPageLayout(window, modelService, >- partService, modelPerspective, perspective, this, true); >- factory.createInitialLayout(modelLayout); >- PerspectiveTagger.tagPerspective(modelPerspective, modelService); >- PerspectiveExtensionReader reader = new PerspectiveExtensionReader(); >- reader.extendLayout(getExtensionTracker(), perspective.getId(), modelLayout); >+ modelPerspective = createPerspective(perspective); > } > > modelPerspective.setLabel(perspective.getLabel()); >@@ -4076,6 +4063,27 @@ > UIEvents.publishEvent(UIEvents.UILifeCycle.PERSPECTIVE_OPENED, modelPerspective); > } > >+ /** >+ * @param perspective >+ * @return never null >+ */ >+ public MPerspective createPerspective(IPerspectiveDescriptor perspective) { >+ MPerspective modelPerspective = modelService.createModelElement(MPerspective.class); >+ >+ // tag it with the same id >+ modelPerspective.setElementId(perspective.getId()); >+ >+ // instantiate the perspective >+ IPerspectiveFactory factory = ((PerspectiveDescriptor) perspective).createFactory(); >+ ModeledPageLayout modelLayout = new ModeledPageLayout(window, modelService, >+ partService, modelPerspective, perspective, this, true); >+ factory.createInitialLayout(modelLayout); >+ PerspectiveTagger.tagPerspective(modelPerspective, modelService); >+ PerspectiveExtensionReader reader = new PerspectiveExtensionReader(); >+ reader.extendLayout(getExtensionTracker(), perspective.getId(), modelLayout); >+ return modelPerspective; >+ } >+ > void perspectiveActionSetChanged(Perspective perspective, IActionSetDescriptor descriptor, > int changeType) { > if (perspective == getActivePerspective()) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 479126
: 257298