Skip to content

Commit

Permalink
Merge pull request #1053 from eclipse-passage/1049-2
Browse files Browse the repository at this point in the history
  • Loading branch information
eparovyshnaya authored Feb 23, 2022
2 parents 827fa26 + ea9911b commit 83cbdcf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Properties file for org.eclipse.passage.loc.workbench
###############################################################################
# Copyright (c) 2018, 2021 ArSysOp and others
# Copyright (c) 2018, 2022 ArSysOp and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -14,7 +14,7 @@

Bundle-Name = Passage LOC Workbench
Bundle-Vendor = Eclipse Passage
Bundle-Copyright = Copyright (c) 2018, 2021 ArSysOp and others.\n\
Bundle-Copyright = Copyright (c) 2018, 2022 ArSysOp and others.\n\
\n\
This program and the accompanying materials are made\n\
available under the terms of the Eclipse Public License 2.0\n\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,22 @@ public static void loadDomainResource(IEclipseContext eclipseContext, String dom
}
}

public static void switchPerspective(IEclipseContext eclipseContext, String perspectiveId) {
EPartService partService = eclipseContext.get(EPartService.class);
public static void switchPerspective(IEclipseContext context, String perspectiveId) {
EPartService partService = context.get(EPartService.class);
if (partService == null) {
return;
}
Optional<MPerspective> switched = partService.switchPerspective(perspectiveId);
if (switched.isPresent()) {
MPerspective perspective = switched.get();
String label = perspective.getLocalizedLabel();
IApplicationContext applicationContext = eclipseContext.get(IApplicationContext.class);
String brandingName = applicationContext.getBrandingName();
String title = brandingName + ' ' + '-' + ' ' + label;
MWindow window = eclipseContext.get(MWindow.class);
IApplicationContext application = context.get(IApplicationContext.class);
if (application == null) {
return;
}
String branding = application.getBrandingName();
String title = branding + ' ' + '-' + ' ' + label;
MWindow window = context.get(MWindow.class);
window.setLabel(title);
}
}
Expand Down

0 comments on commit 83cbdcf

Please sign in to comment.