Skip to content

Commit 145679b

Browse files
committed
Move terminal actions to internal package
Currently actions are available as API types from "o.e.t.control" bundle, but used only from internals of "o.e.t.v.ui" bundle. So, action can be moved to internal package of of "o.e.t.v.ui" bundle to reduce API surface.
1 parent dde5ee2 commit 145679b

25 files changed

+85
-114
lines changed

terminal/bundles/org.eclipse.terminal.control/META-INF/MANIFEST.MF

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Bundle-RequiredExecutionEnvironment: JavaSE-17
1414
Export-Package: org.eclipse.terminal.connector;version="1.0.0",
1515
org.eclipse.terminal.connector.provider;version="1.0.0",
1616
org.eclipse.terminal.control;version="1.0.0",
17-
org.eclipse.terminal.control.actions;version="1.0.0",
1817
org.eclipse.terminal.internal.connector;x-internal:=true,
1918
org.eclipse.terminal.internal.control.impl;x-internal:=true,
2019
org.eclipse.terminal.internal.emulator;x-internal:=true,

terminal/bundles/org.eclipse.terminal.control/build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2003, 2018 Wind River Systems, Inc. and others.
2+
# Copyright (c) 2003, 2025 Wind River Systems, Inc. and others.
33
# All rights reserved. This program and the accompanying materials
44
# are made available under the terms of the Eclipse Public License 2.0
55
# which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@
1616
# Michael Scharf (Wind River) - split into core, view and connector plugins
1717
# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
1818
# Anna Dushistova (MontaVista) - added icons
19+
# Alexander Fedorov (ArSysOp) - further evolution
1920
###############################################################################
2021
bin.includes = .,\
2122
META-INF/,\
@@ -24,7 +25,6 @@ bin.includes = .,\
2425
.options,\
2526
README.txt,\
2627
about.html,\
27-
icons/,\
2828
HelpContexts.xml
2929

3030
source.. = src/

terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/control/impl/ImageConsts.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/control/impl/TerminalPlugin.java

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2003, 2018 Wind River Systems, Inc. and others.
2+
* Copyright (c) 2003, 2025 Wind River Systems, Inc. and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License 2.0
55
* which accompanies this distribution, and is available at
@@ -16,16 +16,11 @@
1616
* Michael Scharf (Wind River) - split into core, view and connector plugins
1717
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
1818
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
19+
* Alexander Fedorov (ArSysOp) - further evolution
1920
*******************************************************************************/
2021
package org.eclipse.terminal.internal.control.impl;
2122

22-
import java.net.MalformedURLException;
23-
import java.net.URL;
24-
2523
import org.eclipse.core.runtime.Platform;
26-
import org.eclipse.jface.resource.ImageDescriptor;
27-
import org.eclipse.jface.resource.ImageRegistry;
28-
import org.eclipse.swt.SWT;
2924
import org.eclipse.ui.plugin.AbstractUIPlugin;
3025
import org.osgi.framework.BundleContext;
3126

@@ -68,30 +63,4 @@ public static boolean isOptionEnabled(String strOption) {
6863
return Boolean.parseBoolean(strEnabled);
6964
}
7065

71-
@Override
72-
protected void initializeImageRegistry(ImageRegistry imageRegistry) {
73-
try {
74-
// Enabled local toolbars
75-
putImageInRegistry(imageRegistry, ImageConsts.IMAGE_ELCL_CLEAR_ALL,
76-
ImageConsts.IMAGE_DIR_ELCL + "clear_co.svg"); //$NON-NLS-1$
77-
// Disabled local toolbars
78-
putDisabledImageInRegistry(imageRegistry, ImageConsts.IMAGE_ELCL_CLEAR_ALL,
79-
ImageConsts.IMAGE_DLCL_CLEAR_ALL);
80-
} catch (MalformedURLException malformedURLException) {
81-
malformedURLException.printStackTrace();
82-
}
83-
}
84-
85-
protected void putImageInRegistry(ImageRegistry imageRegistry, String strKey, String relativePath)
86-
throws MalformedURLException {
87-
URL url = TerminalPlugin.getDefault().getBundle().getEntry(relativePath);
88-
ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(url);
89-
imageRegistry.put(strKey, imageDescriptor);
90-
}
91-
92-
private void putDisabledImageInRegistry(ImageRegistry imageRegistry, String enabledKey, String disabledKey)
93-
throws MalformedURLException {
94-
ImageDescriptor enabledImageDescriptor = imageRegistry.getDescriptor(enabledKey);
95-
imageRegistry.put(disabledKey, ImageDescriptor.createWithFlags(enabledImageDescriptor, SWT.IMAGE_DISABLE));
96-
}
9766
}

terminal/bundles/org.eclipse.terminal.view.ui/META-INF/MANIFEST.MF

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Automatic-Module-Name: org.eclipse.terminal.view.ui
3535
Import-Package: org.eclipse.terminal.connector;version="[1.0.0,2.0.0)",
3636
org.eclipse.terminal.connector.provider;version="[1.0.0,2.0.0)",
3737
org.eclipse.terminal.control;version="[1.0.0,2.0.0)",
38-
org.eclipse.terminal.control.actions;version="[1.0.0,2.0.0)",
3938
org.eclipse.terminal.model;version="[1.0.0,2.0.0)"
4039
Service-Component: OSGI-INF/org.eclipse.terminal.view.ui.internal.ConsoleManager.xml,
4140
OSGI-INF/org.eclipse.terminal.view.ui.internal.LauncherDelegateManager.xml,

terminal/bundles/org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/internal/ImageConsts.java

Lines changed: 12 additions & 1 deletion
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/
@@ -9,6 +9,7 @@
99
* Contributors:
1010
* Wind River Systems - initial API and implementation
1111
* Max Weninger (Wind River) - [361363] [TERMINALS] Implement "Pin&Clone" for the "Terminals" view
12+
* Alexander Fedorov (ArSysOp) - further evolution
1213
*******************************************************************************/
1314
package org.eclipse.terminal.view.ui.internal;
1415

@@ -42,6 +43,16 @@ public interface ImageConsts {
4243
*/
4344
public static final String VIEW_Terminals = "TerminalsView"; //$NON-NLS-1$
4445

46+
/**
47+
* The key to access the clear action image (disabled).
48+
*/
49+
public static final String ACTION_ClearAll_disabled = "ImageDlclClearAll"; //$NON-NLS-1$
50+
51+
/**
52+
* The key to access the clear action image (enabled).
53+
*/
54+
public static final String ACTION_ClearAll_enabled = "ImageElclClearAll"; //$NON-NLS-1$
55+
4556
/**
4657
* The key to access the scroll lock action image (enabled).
4758
*/

terminal/bundles/org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/internal/UIPlugin.java

Lines changed: 8 additions & 1 deletion
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/
@@ -9,6 +9,7 @@
99
* Contributors:
1010
* Wind River Systems - initial API and implementation
1111
* Max Weninger (Wind River) - [361363] [TERMINALS] Implement "Pin&Clone" for the "Terminals" view
12+
* Alexander Fedorov (ArSysOp) - further evolution
1213
*******************************************************************************/
1314
package org.eclipse.terminal.view.ui.internal;
1415

@@ -248,6 +249,12 @@ protected void initializeImageRegistry(ImageRegistry registry) {
248249
ImageDescriptor disabledTerminalViewIcon = ImageDescriptor.createWithFlags(enabledInputFieldIcon,
249250
SWT.IMAGE_DISABLE);
250251
registry.put(ImageConsts.ACTION_NewTerminalView_Disabled, disabledTerminalViewIcon);
252+
URL enabledClearAllIconUrl = bundle
253+
.getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_ELCL + "clear_co.svg"); //$NON-NLS-1$
254+
ImageDescriptor enabledClearAllIcon = ImageDescriptor.createFromURL(enabledClearAllIconUrl);
255+
registry.put(ImageConsts.ACTION_ClearAll_enabled, enabledClearAllIcon);
256+
ImageDescriptor disabledClearAllIcon = ImageDescriptor.createWithFlags(enabledClearAllIcon, SWT.IMAGE_DISABLE);
257+
registry.put(ImageConsts.ACTION_ClearAll_disabled, disabledClearAllIcon);
251258
}
252259

253260
/**

terminal/bundles/org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/internal/actions/AbstractAction.java

Lines changed: 2 additions & 2 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,6 +8,7 @@
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.actions;
1314

@@ -22,7 +23,6 @@
2223
import org.eclipse.osgi.util.NLS;
2324
import org.eclipse.swt.custom.CTabItem;
2425
import org.eclipse.terminal.control.ITerminalViewControl;
25-
import org.eclipse.terminal.control.actions.AbstractTerminalAction;
2626
import org.eclipse.terminal.view.ui.internal.Messages;
2727
import org.eclipse.terminal.view.ui.internal.UIPlugin;
2828
import org.eclipse.terminal.view.ui.internal.tabs.TabFolderManager;
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2004, 2018 Wind River Systems, Inc. and others.
2+
* Copyright (c) 2004, 2025 Wind River Systems, Inc. and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License 2.0
55
* which accompanies this distribution, and is available at
@@ -16,14 +16,15 @@
1616
* Michael Scharf (Wind River) - split into core, view and connector plugins
1717
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
1818
* Anna Dushistova (MontaVista) - Adapted from TerminalAction
19+
* Alexander Fedorov (ArSysOp) - further evolution
1920
*******************************************************************************/
20-
package org.eclipse.terminal.control.actions;
21+
package org.eclipse.terminal.view.ui.internal.actions;
2122

2223
import org.eclipse.jface.action.Action;
2324
import org.eclipse.jface.resource.ImageDescriptor;
2425
import org.eclipse.jface.resource.ImageRegistry;
2526
import org.eclipse.terminal.control.ITerminalViewControl;
26-
import org.eclipse.terminal.internal.control.impl.TerminalPlugin;
27+
import org.eclipse.terminal.view.ui.internal.UIPlugin;
2728

2829
public abstract class AbstractTerminalAction extends Action {
2930
private final ITerminalViewControl fTarget;
@@ -50,7 +51,7 @@ public AbstractTerminalAction(ITerminalViewControl target, String strId, int sty
5051
protected void setupAction(String strText, String strToolTip, String strImage, String strEnabledImage,
5152
String strDisabledImage, boolean bEnabled) {
5253
setupAction(strText, strToolTip, strImage, strEnabledImage, strDisabledImage, bEnabled,
53-
TerminalPlugin.getDefault().getImageRegistry());
54+
UIPlugin.getDefault().getImageRegistry());
5455
}
5556

5657
protected void setupAction(String strText, String strToolTip, String strHoverImage, String strEnabledImage,

0 commit comments

Comments
 (0)