diff options
author | Uwe Stieber | 2012-05-08 06:00:21 +0000 |
---|---|---|
committer | Uwe Stieber | 2012-05-08 06:01:13 +0000 |
commit | 82fbeeb4deb6aaf8bde82072d79cc240e79d6dcf (patch) | |
tree | 85d35a102d5fcac13fcae9d7e22e12e614574ccb /target_explorer/plugins/org.eclipse.tcf.te.ui.terminals | |
parent | 2d9e0bc406d66dd37beed8640e713218c4417d99 (diff) | |
download | org.eclipse.tcf-82fbeeb4deb6aaf8bde82072d79cc240e79d6dcf.tar.gz org.eclipse.tcf-82fbeeb4deb6aaf8bde82072d79cc240e79d6dcf.tar.xz org.eclipse.tcf-82fbeeb4deb6aaf8bde82072d79cc240e79d6dcf.zip |
Target Explorer: Adapt to TM Terminal 3.4M7
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.ui.terminals')
8 files changed, 23 insertions, 259 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF index ad63e8e01..17fbb7994 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF @@ -11,9 +11,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0", org.eclipse.ui;bundle-version="3.7.0", org.eclipse.ui.ide;bundle-version="3.7.0", org.eclipse.ui.forms;bundle-version="3.5.100", - org.eclipse.tm.terminal;bundle-version="3.1.1", - org.eclipse.tm.terminal.telnet;bundle-version="2.1.0", - org.eclipse.tm.terminal.view;bundle-version="2.2.0", + org.eclipse.tm.terminal;bundle-version="3.2.0", org.eclipse.tcf.te.runtime;bundle-version="1.0.0", org.eclipse.tcf.te.runtime.services;bundle-version="1.0.0", org.eclipse.tcf.te.ui;bundle-version="1.0.0", @@ -38,5 +36,4 @@ Export-Package: org.eclipse.tcf.te.ui.terminals.actions, org.eclipse.tcf.te.ui.terminals.services, org.eclipse.tcf.te.ui.terminals.streams, org.eclipse.tcf.te.ui.terminals.tabs, - org.eclipse.tcf.te.ui.terminals.types, - org.eclipse.tcf.te.ui.terminals.view + org.eclipse.tcf.te.ui.terminals.types diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/actions/TabScrollLockAction.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/actions/TabScrollLockAction.java index 762f1b585..8ad484035 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/actions/TabScrollLockAction.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/actions/TabScrollLockAction.java @@ -12,7 +12,7 @@ package org.eclipse.tcf.te.ui.terminals.actions; import org.eclipse.jface.action.IAction; import org.eclipse.tcf.te.ui.terminals.activator.UIPlugin; import org.eclipse.tcf.te.ui.terminals.interfaces.ImageConsts; -import org.eclipse.tm.internal.terminal.actions.ActionMessages; +import org.eclipse.tcf.te.ui.terminals.nls.Messages; import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; import org.eclipse.tm.internal.terminal.control.actions.AbstractTerminalAction; @@ -28,8 +28,8 @@ public class TabScrollLockAction extends AbstractTerminalAction { public TabScrollLockAction() { super(null, TabScrollLockAction.class.getName(), IAction.AS_RADIO_BUTTON); - setupAction(ActionMessages.SCROLL_LOCK_0, - ActionMessages.SCROLL_LOCK_1, + setupAction(Messages.TabScrollLockAction_text, + Messages.TabScrollLockAction_tooltip, UIPlugin.getImageDescriptor(ImageConsts.ACTION_ScrollLock_Hover), UIPlugin.getImageDescriptor(ImageConsts.ACTION_ScrollLock_Enabled), UIPlugin.getImageDescriptor(ImageConsts.ACTION_ScrollLock_Disabled), diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java index 8daa13007..32d964837 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java @@ -48,13 +48,11 @@ import org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate; import org.eclipse.tcf.te.ui.terminals.launcher.LauncherDelegateManager;
import org.eclipse.tcf.te.ui.terminals.nls.Messages;
import org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel;
-import org.eclipse.tm.internal.terminal.view.ViewMessages;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* Launch terminal settings dialog implementation.
*/
-@SuppressWarnings("restriction")
public class LaunchTerminalSettingsDialog extends CustomTrayDialog {
// The parent selection
private ISelection selection = null;
@@ -337,10 +335,10 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog { IWizardConfigurationPanel panel = this.settings.getConfigurationPanel(terminals.getText());
if(!panel.isValid()){
- String strTitle = ViewMessages.TERMINALSETTINGS;
+ String strTitle = Messages.LaunchTerminalSettingsDialog_error_title;
MessageBox mb = new MessageBox(getShell(), SWT.ICON_ERROR | SWT.OK);
mb.setText(strTitle);
- mb.setMessage(ViewMessages.INVALID_SETTINGS);
+ mb.setMessage(Messages.LaunchTerminalSettingsDialog_error_invalidSettings);
mb.open();
return;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/nls/Messages.java index 7e0c33fb0..031c3853c 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/nls/Messages.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/nls/Messages.java @@ -57,4 +57,12 @@ public class Messages extends NLS { public static String LaunchTerminalSettingsDialog_title; public static String LaunchTerminalSettingsDialog_combo_label; public static String LaunchTerminalSettingsDialog_group_label; + + public static String TabScrollLockAction_text; + public static String TabScrollLockAction_tooltip; + + public static String LaunchTerminalSettingsDialog_error_title; + public static String LaunchTerminalSettingsDialog_error_invalidSettings; + + } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/nls/Messages.properties index 2edd4b2a1..691f5e658 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/nls/Messages.properties +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/nls/Messages.properties @@ -29,3 +29,9 @@ TerminalService_defaultTitle=Console LaunchTerminalSettingsDialog_title=Launch Terminal LaunchTerminalSettingsDialog_combo_label=Choose terminal: LaunchTerminalSettingsDialog_group_label=Settings + +TabScrollLockAction_text=Scroll &Lock +TabScrollLockAction_tooltip=Scroll Lock + +LaunchTerminalSettingsDialog_error_title=Terminal Settings +LaunchTerminalSettingsDialog_error_invalidSettings=The specified settings are invalid, please review or cancel. diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderManager.java index 11539b688..111f3c367 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderManager.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderManager.java @@ -17,10 +17,6 @@ import java.util.List; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.core.runtime.Preferences.PropertyChangeEvent; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionProvider; @@ -53,15 +49,13 @@ import org.eclipse.tm.internal.terminal.emulator.VT100TerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; -import org.eclipse.tm.internal.terminal.view.TerminalPreferencePage; -import org.eclipse.tm.internal.terminal.view.TerminalViewPlugin; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.ide.IDEEncoding; /** * Terminals tab folder manager. */ -@SuppressWarnings({ "restriction", "deprecation" }) +@SuppressWarnings({ "restriction" }) public class TabFolderManager extends PlatformObject implements ISelectionProvider { // Reference to the parent terminal consoles view private final ITerminalsView parentView; @@ -520,54 +514,11 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid Assert.isNotNull(item); // Create and associate the disposal listener - DisposeListener disposeListener=doCreateTerminalTabDisposeListener(this); + DisposeListener disposeListener = doCreateTerminalTabDisposeListener(this); // store the listener to make access easier e.g. needed in DnD item.setData("disposeListener", disposeListener); //$NON-NLS-1$ item.addDisposeListener(disposeListener); - - // Create and register the property change listener - final IPropertyChangeListener propertyChangeListener = doCreateTerminalTabPropertyChangeListener(item); - // Register to the JFace font registry - JFaceResources.getFontRegistry().addListener(propertyChangeListener); - - // Create and register the Terminal view plugin preferences property change listener - final Preferences.IPropertyChangeListener prefsPropertyChangeListener = new Preferences.IPropertyChangeListener() { - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent) - */ - @Override - public void propertyChange(PropertyChangeEvent event) { - if (item.isDisposed()) return; - - if(event.getProperty().equals(TerminalPreferencePage.PREF_BUFFERLINES) - || event.getProperty().equals(TerminalPreferencePage.PREF_INVERT_COLORS)) { - Preferences preferences = TerminalViewPlugin.getDefault().getPluginPreferences(); - int bufferLineLimit = preferences.getInt(TerminalPreferencePage.PREF_BUFFERLINES); - boolean invert = preferences.getBoolean(TerminalPreferencePage.PREF_INVERT_COLORS); - - // Get the terminal control from the tab item - if (item.getData() instanceof ITerminalViewControl) { - ITerminalViewControl terminal = (ITerminalViewControl)item.getData(); - terminal.setBufferLineLimit(bufferLineLimit); - terminal.setInvertedColors(invert); - } - } - } - }; - - // Register to the Terminal view plugin preferences - TerminalViewPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(prefsPropertyChangeListener); - - // Remove the listener from the JFace font registry if the tab gets disposed - item.addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - JFaceResources.getFontRegistry().removeListener(propertyChangeListener); - TerminalViewPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(prefsPropertyChangeListener); - } - }); } /** @@ -593,17 +544,6 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid } /** - * Creates a new terminal console tab property change listener instance. - * - * @param item The tab item. Must not be <code>null</code>. - * @return The property change listener instance. - */ - protected IPropertyChangeListener doCreateTerminalTabPropertyChangeListener(CTabItem item) { - Assert.isNotNull(item); - return new TabPropertyChangeListener(item); - } - - /** * Returns the tab item image. * * @param connector The terminal connector. Must not be <code>null</code>. diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabPropertyChangeListener.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabPropertyChangeListener.java deleted file mode 100644 index 453fb70d6..000000000 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabPropertyChangeListener.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved. - * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tcf.te.ui.terminals.tabs; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.graphics.Font; -import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; -import org.eclipse.tm.internal.terminal.view.TerminalView; - -/** - * Terminals tab default property change listener implementation. - */ -@SuppressWarnings("restriction") -public class TabPropertyChangeListener implements IPropertyChangeListener { - /** - * Default terminal font property key. - * - * @see TerminalView#FONT_DEFINITION - */ - public static final String FONT_DEFINITION = "terminal.views.view.font.definition"; //$NON-NLS-1$ - - // Reference to the parent tab item - private final CTabItem tabItem; - - /** - * Constructor. - * - * @param tabItem The parent tab item. Must not be <code>null</code>. - */ - public TabPropertyChangeListener(CTabItem tabItem) { - super(); - Assert.isNotNull(tabItem); - this.tabItem = tabItem; - } - - /** - * Returns the associated parent tab item. - * - * @return The parent tab item. - */ - protected final CTabItem getTabItem() { - return tabItem; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) - */ - @Override - public void propertyChange(PropertyChangeEvent event) { - // In case we are called once after the tab item got disposed - // --> Do nothing - if (getTabItem() == null || getTabItem().isDisposed()) return; - - // Listen to changes of the Font settings - if (event.getProperty().equals(FONT_DEFINITION)) { - onFontDefinitionProperyChanged(); - } - } - - /** - * Called if a property change event for the terminal font - * definition is received. - */ - protected void onFontDefinitionProperyChanged() { - // Get the current font from JFace - Font font = JFaceResources.getFont(FONT_DEFINITION); - // Get the terminal control from the tab item - if (getTabItem().getData() instanceof ITerminalViewControl) { - ITerminalViewControl terminal = (ITerminalViewControl)getTabItem().getData(); - terminal.setFont(font); - } - } -} diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/types/TelnetConnectorType.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/types/TelnetConnectorType.java deleted file mode 100644 index 48d58897a..000000000 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/types/TelnetConnectorType.java +++ /dev/null @@ -1,101 +0,0 @@ -/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.ui.terminals.types;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.interfaces.constants.ITerminalsConnectorConstants;
-import org.eclipse.tcf.te.ui.terminals.internal.SettingsStore;
-import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore;
-import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
-import org.eclipse.tm.internal.terminal.provisional.api.TerminalConnectorExtension;
-import org.eclipse.tm.internal.terminal.telnet.TelnetSettings;
-
-/**
- * Telnet terminal connector type implementation.
- */
-@SuppressWarnings("restriction")
-public class TelnetConnectorType extends AbstractConnectorType {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.terminals.interfaces.IConnectorType#createTerminalConnector(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public ITerminalConnector createTerminalConnector(IPropertiesContainer properties) {
- Assert.isNotNull(properties);
-
- // Check for the terminal connector id
- String connectorId = properties.getStringProperty(ITerminalsConnectorConstants.PROP_TERMINAL_CONNECTOR_ID);
-
- // Extract the telnet properties
- String host = properties.getStringProperty(ITerminalsConnectorConstants.PROP_IP_HOST);
- String port = properties.getStringProperty(ITerminalsConnectorConstants.PROP_IP_PORT);
- String timeout = properties.getStringProperty(ITerminalsConnectorConstants.PROP_TIMEOUT);
-
- int portOffset = 0;
- if (properties.getProperty(ITerminalsConnectorConstants.PROP_IP_PORT_OFFSET) != null) {
- portOffset = properties.getIntProperty(ITerminalsConnectorConstants.PROP_IP_PORT_OFFSET);
- if (portOffset < 0) portOffset = 0;
- }
-
- return host != null && port != null ? createTelnetConnector(connectorId, new String[] { host, port, timeout }, portOffset) : null;
- }
-
- /**
- * Creates a terminal connector object based on the given telnet server attributes.
- * <p>
- * The telnet server attributes must contain at least 2 elements:
- * <ul>
- * <li>attributes[0] --> telnet server host name</li>
- * <li>attributes[1] --> telnet port</li>
- * <li>attributes[2] --> timeout (optional)</li>
- * </ul>
- *
- * @param connectorId The terminal connector id or <code>null</code>.
- * @param attributes The telnet server attributes. Must not be <code>null</code> and must have at least two elements.
- * @param portOffset Offset to add to the port.
- *
- * @return The terminal connector object instance or <code>null</code>.
- */
- protected ITerminalConnector createTelnetConnector(String connectorId, String[] attributes, int portOffset) {
- Assert.isNotNull(attributes);
- Assert.isTrue(attributes.length >= 2);
-
- if (connectorId == null) connectorId = "org.eclipse.tm.internal.terminal.telnet.TelnetConnector"; //$NON-NLS-1$
-
- final String serverName = attributes[0];
- final String serverPort = Integer.toString(Integer.decode(attributes[1]).intValue() + portOffset);
- final String timeout = attributes.length >= 3 ? attributes[2] : null;
-
- // Construct the terminal settings store
- ISettingsStore store = new SettingsStore();
-
- // Construct the telnet settings
- TelnetSettings telnetSettings = new TelnetSettings();
- telnetSettings.setHost(serverName);
- telnetSettings.setNetworkPort(serverPort);
- if (timeout != null) {
- telnetSettings.setTimeout(timeout);
- }
- // And save the settings to the store
- telnetSettings.save(store);
-
- // Construct the terminal connector instance
- ITerminalConnector connector = TerminalConnectorExtension.makeTerminalConnector(connectorId);
- if (connector != null) {
- // Apply default settings
- connector.makeSettingsPage();
- // And load the real settings
- connector.load(store);
- }
-
- return connector;
- }
-}
|