Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1049 #1053

Merged
merged 2 commits into from
Feb 23, 2022
Merged

#1049 #1053

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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