Skip to content

Commit a9793d3

Browse files
committed
Prefer view id constant from IUIConstants
There is an API constant for terminal view id, it is better to use it instead of hard-coded string literals.
1 parent 8e520e1 commit a9793d3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

terminal/bundles/org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/internal/listeners/WorkbenchPartListener.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2018 Wind River Systems, Inc. and others. All rights reserved.
2+
* Copyright (c) 2011, 2025 Wind River Systems, Inc. and others. All rights reserved.
33
* This program and the accompanying materials are made available under the terms
44
* of the Eclipse Public License 2.0 which accompanies this distribution, and is
55
* available at https://www.eclipse.org/legal/epl-2.0/
@@ -8,12 +8,14 @@
88
*
99
* Contributors:
1010
* Wind River Systems - initial API and implementation
11+
* Alexander Fedorov (ArSysOp) - further evolution
1112
*******************************************************************************/
1213
package org.eclipse.terminal.view.ui.internal.listeners;
1314

1415
import java.util.HashMap;
1516
import java.util.Map;
1617

18+
import org.eclipse.terminal.view.ui.IUIConstants;
1719
import org.eclipse.ui.IPartListener2;
1820
import org.eclipse.ui.IWorkbenchPart;
1921
import org.eclipse.ui.IWorkbenchPartReference;
@@ -51,7 +53,7 @@ public void partHidden(IWorkbenchPartReference partRef) {
5153

5254
@Override
5355
public void partActivated(IWorkbenchPartReference partRef) {
54-
if ("org.eclipse.terminal.view.ui.TerminalsView".equals(partRef.getId())) { //$NON-NLS-1$
56+
if (IUIConstants.ID.equals(partRef.getId())) {
5557
IWorkbenchPart part = partRef.getPart(false);
5658
if (part != null && part.getSite() != null) {
5759
IContextService service = part.getSite().getService(IContextService.class);
@@ -69,7 +71,7 @@ public void partActivated(IWorkbenchPartReference partRef) {
6971

7072
@Override
7173
public void partDeactivated(IWorkbenchPartReference partRef) {
72-
if ("org.eclipse.terminal.view.ui.TerminalsView".equals(partRef.getId())) { //$NON-NLS-1$
74+
if (IUIConstants.ID.equals(partRef.getId())) {
7375
IWorkbenchPart part = partRef.getPart(false);
7476
if (part != null && part.getSite() != null) {
7577
IContextService service = part.getSite().getService(IContextService.class);

0 commit comments

Comments
 (0)