mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Fixed the neming scheme to use tm.internal.terminal instead of tm.terminal.internal
This commit is contained in:
parent
8d670efac5
commit
c792375d13
66 changed files with 1969 additions and 68 deletions
|
@ -1,11 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4">
|
||||
<accessrules>
|
||||
<accessrule kind="accessible" pattern="gnu/io/**"/>
|
||||
</accessrules>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -13,5 +13,5 @@ Eclipse-BuddyPolicy: ext
|
|||
Bundle-Vendor: %providerName
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.4
|
||||
Bundle-ClassPath: .
|
||||
Bundle-Activator: org.eclipse.tm.terminal.internal.serial.Activator
|
||||
Export-Package: org.eclipse.tm.terminal.internal.serial;x-internal:=true
|
||||
Bundle-Activator: org.eclipse.tm.internal.terminal.serial.Activator
|
||||
Export-Package: org.eclipse.tm.internal.terminal.serial;x-internal:=true
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
<plugin>
|
||||
<extension
|
||||
point="org.eclipse.tm.terminal.terminalConnector">
|
||||
<connector class="org.eclipse.tm.terminal.internal.serial.SerialConnector"/>
|
||||
<connector class="org.eclipse.tm.internal.terminal.serial.SerialConnector"/>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.eclipse.tm.terminal.internal.serial;
|
||||
package org.eclipse.tm.internal.terminal.serial;
|
||||
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
|
@ -9,7 +9,7 @@
|
|||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.serial;
|
||||
package org.eclipse.tm.internal.terminal.serial;
|
||||
|
||||
import org.eclipse.tm.terminal.ISettingsStore;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalControl
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.serial;
|
||||
package org.eclipse.tm.internal.terminal.serial;
|
||||
|
||||
import gnu.io.CommPortIdentifier;
|
||||
import gnu.io.PortInUseException;
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalControl
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.serial;
|
||||
package org.eclipse.tm.internal.terminal.serial;
|
||||
|
||||
import gnu.io.CommPortIdentifier;
|
||||
import gnu.io.SerialPort;
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.serial;
|
||||
package org.eclipse.tm.internal.terminal.serial;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
public class SerialMessages extends NLS {
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalControl
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.serial;
|
||||
package org.eclipse.tm.internal.terminal.serial;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.MessageFormat;
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalProperties
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.serial;
|
||||
package org.eclipse.tm.internal.terminal.serial;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalSettings
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.serial;
|
||||
package org.eclipse.tm.internal.terminal.serial;
|
||||
|
||||
import gnu.io.SerialPort;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalSettingsDlg
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.serial;
|
||||
package org.eclipse.tm.internal.terminal.serial;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
|
@ -1,11 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
|
||||
<accessrules>
|
||||
<accessrule kind="discouraged" pattern="**/internal/**"/>
|
||||
</accessrules>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
|
||||
<accessrules>
|
||||
<accessrule kind="discouraged" pattern="**/internal/**"/>
|
||||
</accessrules>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal.view;singleton:=true
|
||||
Bundle-Version: 0.9.1.qualifier
|
||||
Bundle-Activator: org.eclipse.tm.terminal.internal.view.TerminalViewPlugin
|
||||
Bundle-Activator: org.eclipse.tm.internal.terminal.view.TerminalViewPlugin
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
|
@ -11,5 +11,5 @@ Require-Bundle: org.eclipse.ui,
|
|||
Eclipse-LazyStart: true
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.4
|
||||
Bundle-Vendor: %providerName
|
||||
Export-Package: org.eclipse.tm.terminal.internal.actions;x-internal:=true,
|
||||
org.eclipse.tm.terminal.internal.view;x-internal:=true
|
||||
Export-Package: org.eclipse.tm.internal.terminal.actions;x-internal:=true,
|
||||
org.eclipse.tm.internal.terminal.view;x-internal:=true
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</category>
|
||||
<view
|
||||
allowMultiple="true"
|
||||
class="org.eclipse.tm.terminal.internal.view.TerminalView"
|
||||
class="org.eclipse.tm.internal.terminal.view.TerminalView"
|
||||
icon="icons/cview16/terminal_view.gif"
|
||||
category="Terminal"
|
||||
name="%terminal.views.view.name"
|
||||
|
@ -46,7 +46,7 @@
|
|||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
name="%terminal.views.view.name"
|
||||
class="org.eclipse.tm.terminal.internal.view.TerminalPreferencePage"
|
||||
class="org.eclipse.tm.internal.terminal.view.TerminalPreferencePage"
|
||||
id="org.eclipse.tm.terminal.TerminalPreferencePage">
|
||||
</page>
|
||||
</extension>
|
||||
|
@ -75,6 +75,6 @@
|
|||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.core.runtime.preferences">
|
||||
<initializer class="org.eclipse.tm.terminal.internal.view.TerminalPreferenceInitializer"/>
|
||||
<initializer class="org.eclipse.tm.internal.terminal.view.TerminalPreferenceInitializer"/>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
public class ActionMessages extends NLS {
|
||||
static {
|
||||
NLS.initializeMessages(ActionMessages.class.getName(), ActionMessages.class);
|
||||
}
|
||||
public static String NEW_TERMINAL;
|
||||
public static String CONNECT;
|
||||
public static String DISCONNECT;
|
||||
public static String SETTINGS_ELLIPSE;
|
||||
public static String COPY;
|
||||
public static String CUT;
|
||||
public static String PASTE;
|
||||
public static String SELECTALL;
|
||||
public static String CLEARALL;
|
||||
public static String SETTINGS;
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
###############################################################################
|
||||
# Copyright (c) 2003, 2006 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
|
||||
#
|
||||
# Initial Contributors:
|
||||
# The following Wind River employees contributed to the Terminal component
|
||||
# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
# Helmut Haigermoser and Ted Williams.
|
||||
#
|
||||
# Contributors:
|
||||
# Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
###############################################################################
|
||||
NEW_TERMINAL = New Terminal
|
||||
CONNECT = Connect
|
||||
DISCONNECT = Disconnect
|
||||
SETTINGS_ELLIPSE = Settings...
|
||||
COPY = Copy
|
||||
CUT = Cut
|
||||
PASTE = Paste
|
||||
SELECTALL = Select All
|
||||
CLEARALL = Clear All
|
||||
SETTINGS = Settings
|
|
@ -0,0 +1,72 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
import org.eclipse.tm.internal.terminal.view.TerminalViewPlugin;
|
||||
|
||||
abstract public class TerminalAction extends Action {
|
||||
protected final ITerminalView fTarget;
|
||||
public TerminalAction(ITerminalView target, String strId) {
|
||||
super(""); //$NON-NLS-1$
|
||||
|
||||
fTarget = target;
|
||||
|
||||
setId(strId);
|
||||
}
|
||||
abstract public void run();
|
||||
protected void setupAction(String strText, String strToolTip,
|
||||
String strImage, String strEnabledImage, String strDisabledImage,
|
||||
boolean bEnabled) {
|
||||
TerminalViewPlugin plugin;
|
||||
ImageRegistry imageRegistry;
|
||||
|
||||
plugin = TerminalViewPlugin.getDefault();
|
||||
imageRegistry = plugin.getImageRegistry();
|
||||
setupAction(strText, strToolTip, strImage, strEnabledImage,
|
||||
strDisabledImage, bEnabled, imageRegistry);
|
||||
}
|
||||
protected void setupAction(String strText, String strToolTip,
|
||||
String strHoverImage, String strEnabledImage, String strDisabledImage,
|
||||
boolean bEnabled, ImageRegistry imageRegistry) {
|
||||
setupAction(strText,
|
||||
strToolTip,
|
||||
imageRegistry.getDescriptor(strHoverImage),
|
||||
imageRegistry.getDescriptor(strEnabledImage),
|
||||
imageRegistry.getDescriptor(strDisabledImage),
|
||||
bEnabled);
|
||||
}
|
||||
protected void setupAction(String strText, String strToolTip,
|
||||
ImageDescriptor hoverImage, ImageDescriptor enabledImage, ImageDescriptor disabledImage,
|
||||
boolean bEnabled) {
|
||||
setText(strText);
|
||||
setToolTipText(strToolTip);
|
||||
setEnabled(bEnabled);
|
||||
if (enabledImage != null) {
|
||||
setImageDescriptor(enabledImage);
|
||||
}
|
||||
if (disabledImage != null) {
|
||||
setDisabledImageDescriptor(disabledImage);
|
||||
}
|
||||
if (hoverImage != null) {
|
||||
setHoverImageDescriptor(hoverImage);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
|
||||
public class TerminalActionClearAll extends TerminalAction
|
||||
{
|
||||
public TerminalActionClearAll(ITerminalView target)
|
||||
{
|
||||
super(target,
|
||||
TerminalActionClearAll.class.getName());
|
||||
|
||||
setupAction(ActionMessages.CLEARALL,
|
||||
ActionMessages.CLEARALL,
|
||||
(ImageDescriptor)null,
|
||||
null,
|
||||
null,
|
||||
false);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
fTarget.onEditClearAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
||||
|
||||
public class TerminalActionConnect extends TerminalAction
|
||||
{
|
||||
public TerminalActionConnect(ITerminalView target)
|
||||
{
|
||||
super(target,
|
||||
TerminalActionConnect.class.getName());
|
||||
|
||||
setupAction(ActionMessages.CONNECT,
|
||||
ActionMessages.CONNECT,
|
||||
ImageConsts.IMAGE_CLCL_CONNECT,
|
||||
ImageConsts.IMAGE_ELCL_CONNECT,
|
||||
ImageConsts.IMAGE_DLCL_CONNECT,
|
||||
true);
|
||||
}
|
||||
public void run() {
|
||||
fTarget.onTerminalConnect();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
public class TerminalActionCopy extends TerminalAction
|
||||
{
|
||||
public TerminalActionCopy(ITerminalView target)
|
||||
{
|
||||
super(target,
|
||||
TerminalActionCopy.class.getName());
|
||||
ISharedImages si = PlatformUI.getWorkbench().getSharedImages();
|
||||
setupAction(ActionMessages.COPY,
|
||||
ActionMessages.COPY,
|
||||
si.getImageDescriptor(ISharedImages.IMG_TOOL_COPY),
|
||||
si.getImageDescriptor(ISharedImages.IMG_TOOL_COPY),
|
||||
si.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED),
|
||||
true);
|
||||
}
|
||||
public void run() {
|
||||
fTarget.onEditCopy();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
public class TerminalActionCut extends TerminalAction
|
||||
{
|
||||
public TerminalActionCut(ITerminalView target)
|
||||
{
|
||||
super(target,
|
||||
TerminalActionCut.class.getName());
|
||||
ISharedImages si = PlatformUI.getWorkbench().getSharedImages();
|
||||
setupAction(ActionMessages.CUT,
|
||||
ActionMessages.CUT,
|
||||
si.getImageDescriptor(ISharedImages.IMG_TOOL_CUT),
|
||||
si.getImageDescriptor(ISharedImages.IMG_TOOL_CUT),
|
||||
si.getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED),
|
||||
true);
|
||||
}
|
||||
public void run() {
|
||||
fTarget.onEditCut();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
||||
|
||||
public class TerminalActionDisconnect extends TerminalAction
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public TerminalActionDisconnect(ITerminalView target)
|
||||
{
|
||||
super(target,
|
||||
TerminalActionDisconnect.class.getName());
|
||||
|
||||
setupAction(ActionMessages.DISCONNECT,
|
||||
ActionMessages.DISCONNECT,
|
||||
ImageConsts.IMAGE_CLCL_DISCONNECT,
|
||||
ImageConsts.IMAGE_ELCL_DISCONNECT,
|
||||
ImageConsts.IMAGE_DLCL_DISCONNECT,
|
||||
false);
|
||||
}
|
||||
public void run() {
|
||||
fTarget.onTerminalDisconnect();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
||||
|
||||
/**
|
||||
* UNDER CONSTRUCTION
|
||||
*
|
||||
* @author Fran Litterio <francis.litterio@windriver.com>
|
||||
*/
|
||||
public class TerminalActionNewTerminal extends TerminalAction
|
||||
{
|
||||
/**
|
||||
* UNDER CONSTRUCTION
|
||||
*/
|
||||
public TerminalActionNewTerminal(ITerminalView target)
|
||||
{
|
||||
super(target, TerminalActionNewTerminal.class.getName());
|
||||
|
||||
setupAction(ActionMessages.NEW_TERMINAL,
|
||||
ActionMessages.NEW_TERMINAL,
|
||||
ImageConsts.IMAGE_NEW_TERMINAL,
|
||||
ImageConsts.IMAGE_NEW_TERMINAL,
|
||||
ImageConsts.IMAGE_NEW_TERMINAL,
|
||||
true);
|
||||
}
|
||||
public void run() {
|
||||
fTarget.onTerminalNewTerminal();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
public class TerminalActionPaste extends TerminalAction
|
||||
{
|
||||
public TerminalActionPaste(ITerminalView target)
|
||||
{
|
||||
super(target,
|
||||
TerminalActionPaste.class.getName());
|
||||
ISharedImages si = PlatformUI.getWorkbench().getSharedImages();
|
||||
setupAction(ActionMessages.PASTE,
|
||||
ActionMessages.PASTE,
|
||||
si.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE),
|
||||
si.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED),
|
||||
si.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE),
|
||||
false);
|
||||
}
|
||||
public void run() {
|
||||
fTarget.onEditPaste();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
|
||||
public class TerminalActionSelectAll extends TerminalAction
|
||||
{
|
||||
public TerminalActionSelectAll(ITerminalView target)
|
||||
{
|
||||
super(target,
|
||||
TerminalActionSelectAll.class.getName());
|
||||
|
||||
setupAction(ActionMessages.SELECTALL,
|
||||
ActionMessages.SELECTALL,
|
||||
(ImageDescriptor)null,
|
||||
null,
|
||||
null,
|
||||
false);
|
||||
}
|
||||
public void run() {
|
||||
fTarget.onEditSelectAll();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.actions;
|
||||
|
||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||
import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
||||
|
||||
public class TerminalActionSettings extends TerminalAction
|
||||
{
|
||||
public TerminalActionSettings(ITerminalView target)
|
||||
{
|
||||
super(target,
|
||||
TerminalActionSettings.class.getName());
|
||||
|
||||
setupAction(ActionMessages.SETTINGS_ELLIPSE,
|
||||
ActionMessages.SETTINGS,
|
||||
ImageConsts.IMAGE_CLCL_SETTINGS,
|
||||
ImageConsts.IMAGE_ELCL_SETTINGS,
|
||||
ImageConsts.IMAGE_DLCL_SETTINGS,
|
||||
true);
|
||||
}
|
||||
public void run() {
|
||||
fTarget.onTerminalSettings();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006 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:
|
||||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
public interface ITerminalView {
|
||||
|
||||
/**
|
||||
* Display a new Terminal view. This method is called when the user clicks the New
|
||||
* Terminal button in any Terminal view's toolbar.
|
||||
*/
|
||||
public void onTerminalNewTerminal();
|
||||
public void onTerminalConnect();
|
||||
public void onTerminalDisconnect();
|
||||
public void onTerminalSettings();
|
||||
public void onTerminalFontChanged();
|
||||
public void onEditCopy();
|
||||
public void onEditCut();
|
||||
public void onEditPaste();
|
||||
public void onEditClearAll();
|
||||
public void onEditSelectAll();
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - extracted from TerminalConsts
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
public interface ImageConsts
|
||||
{
|
||||
public final static String IMAGE_DIR_ROOT = "icons/"; //$NON-NLS-1$
|
||||
public final static String IMAGE_DIR_CTOOL = "ctool16/"; // basic colors - size 16x16 //$NON-NLS-1$
|
||||
public final static String IMAGE_DIR_LOCALTOOL = "clcl16/"; // basic colors - size 16x16 //$NON-NLS-1$
|
||||
public final static String IMAGE_DIR_DLCL = "dlcl16/"; // disabled - size 16x16 //$NON-NLS-1$
|
||||
public final static String IMAGE_DIR_ELCL = "elcl16/"; // enabled - size 16x16 //$NON-NLS-1$
|
||||
public final static String IMAGE_DIR_OBJECT = "obj16/"; // basic colors - size 16x16 //$NON-NLS-1$
|
||||
public final static String IMAGE_DIR_WIZBAN = "wizban/"; // basic colors - size 16x16 //$NON-NLS-1$
|
||||
public final static String IMAGE_DIR_OVR = "ovr16/"; // basic colors - size 7x8 //$NON-NLS-1$
|
||||
public final static String IMAGE_DIR_VIEW = "cview16/"; // views //$NON-NLS-1$
|
||||
public final static String IMAGE_DIR_EVIEW = "eview16/"; // views //$NON-NLS-1$
|
||||
|
||||
public static final String IMAGE_NEW_TERMINAL = "TerminalViewNewTerminal"; //$NON-NLS-1$
|
||||
public static final String IMAGE_CLCL_CONNECT = "ImageClclConnect"; //$NON-NLS-1$
|
||||
public static final String IMAGE_CLCL_DISCONNECT = "ImageClclDisconnect"; //$NON-NLS-1$
|
||||
public static final String IMAGE_CLCL_SETTINGS = "ImageClclSettings"; //$NON-NLS-1$
|
||||
|
||||
public static final String IMAGE_DLCL_CONNECT = "ImageDlclConnect"; //$NON-NLS-1$
|
||||
public static final String IMAGE_DLCL_DISCONNECT = "ImageDlclDisconnect"; //$NON-NLS-1$
|
||||
public static final String IMAGE_DLCL_SETTINGS = "ImageDlclSettings"; //$NON-NLS-1$
|
||||
|
||||
public static final String IMAGE_ELCL_CONNECT = "ImageElclConnect"; //$NON-NLS-1$
|
||||
public static final String IMAGE_ELCL_DISCONNECT = "ImageElclDisconnect"; //$NON-NLS-1$
|
||||
public static final String IMAGE_ELCL_SETTINGS = "ImageElclSettings"; //$NON-NLS-1$
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006 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:
|
||||
* Michael Scharf (Wind River) - simplified implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
import org.eclipse.swt.custom.StackLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
||||
/**
|
||||
* A pagebook is a composite control where only a single control is visible
|
||||
* at a time. It is similar to a notebook, but without tabs.
|
||||
* <p>
|
||||
* This class may be instantiated; it is not intended to be subclassed.
|
||||
* </p>
|
||||
*
|
||||
*/
|
||||
public class PageBook extends Composite {
|
||||
private StackLayout fLayout;
|
||||
public PageBook(Composite parent, int style) {
|
||||
super(parent, style);
|
||||
fLayout= new StackLayout();
|
||||
setLayout(fLayout);
|
||||
}
|
||||
public void showPage(Control page) {
|
||||
fLayout.topControl= page;
|
||||
layout();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006 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:
|
||||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
import org.eclipse.tm.terminal.ISettingsStore;
|
||||
|
||||
public class SettingStorePrefixDecorator implements ISettingsStore {
|
||||
private final String fPrefix;
|
||||
private final ISettingsStore fStore;
|
||||
SettingStorePrefixDecorator(ISettingsStore store,String prefix) {
|
||||
fPrefix=prefix;
|
||||
fStore=store;
|
||||
}
|
||||
|
||||
public String get(String key) {
|
||||
return fStore.get(fPrefix+key);
|
||||
}
|
||||
|
||||
public String get(String key, String defaultValue) {
|
||||
return fStore.get(fPrefix+key,defaultValue);
|
||||
}
|
||||
|
||||
public void put(String key, String value) {
|
||||
fStore.put(fPrefix+key,value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006 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:
|
||||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.dialogs.IDialogSettings;
|
||||
import org.eclipse.tm.terminal.ISettingsStore;
|
||||
import org.eclipse.ui.IMemento;
|
||||
|
||||
/**
|
||||
* A {@link IDialogSettings} based {@link ISettingsStore}.
|
||||
*
|
||||
* Setting Store dased on IMemento. IMemento documentations says only alpha numeric
|
||||
* values mey be used as keys. Therefore the implementation converts dots (.) into
|
||||
* child elements of the memento.
|
||||
*
|
||||
* @author Michael Scharf
|
||||
*/
|
||||
class SettingsStore implements ISettingsStore {
|
||||
|
||||
private static final String KEYS = "_keys_"; //$NON-NLS-1$
|
||||
final private Map fMap=new HashMap();
|
||||
public SettingsStore(IMemento memento) {
|
||||
if(memento==null)
|
||||
return;
|
||||
// load all keys ever used from the memento
|
||||
String keys=memento.getString(KEYS);
|
||||
if(keys!=null) {
|
||||
String[] keyNames=keys.split(","); //$NON-NLS-1$
|
||||
for (int i = 0; i < keyNames.length; i++) {
|
||||
String key=keyNames[i];
|
||||
if(!KEYS.equals(key)) {
|
||||
// get the dot separated elements
|
||||
String[] path=key.split("\\."); //$NON-NLS-1$
|
||||
IMemento m=memento;
|
||||
// iterate over all but the last segment and get the children...
|
||||
for(int iPath=0; m!=null && iPath+1<path.length; iPath++) {
|
||||
m=m.getChild(path[iPath]);
|
||||
}
|
||||
if(m!=null) {
|
||||
// cache the value in the map
|
||||
fMap.put(key,m.getString(path[path.length-1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String get(String key) {
|
||||
return get(key,null);
|
||||
}
|
||||
public String get(String key, String defaultValue) {
|
||||
String value = (String) fMap.get(key);
|
||||
if ((value == null) || (value.equals(""))) //$NON-NLS-1$
|
||||
return defaultValue;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public void put(String key, String value) {
|
||||
if(!key.matches("^[\\w.]+$")) //$NON-NLS-1$
|
||||
throw new IllegalArgumentException("Key '"+key+"' is not alpha numeric or '.'!"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// null values remove the key from the map
|
||||
if ((value == null) || (value.equals(""))) //$NON-NLS-1$
|
||||
fMap.remove(key);
|
||||
else
|
||||
fMap.put(key, value);
|
||||
}
|
||||
/**
|
||||
* Save the state into memento.
|
||||
* @param memento
|
||||
*/
|
||||
public void saveState(IMemento memento) {
|
||||
String[] keyNames=(String[]) fMap.keySet().toArray(new String[fMap.size()]);
|
||||
Arrays.sort(keyNames);
|
||||
StringBuffer buffer=new StringBuffer();
|
||||
for (int i = 0; i < keyNames.length; i++) {
|
||||
String key=keyNames[i];
|
||||
String[] path=key.split("\\."); //$NON-NLS-1$
|
||||
IMemento m=memento;
|
||||
// iterate over all but the last segment and get the children...
|
||||
for(int iPath=0; iPath+1<path.length; iPath++) {
|
||||
IMemento child=m.getChild(path[iPath]);
|
||||
// if the child does not exist, create it
|
||||
if(child==null)
|
||||
child=m.createChild(path[iPath]);
|
||||
m=child;
|
||||
}
|
||||
// use the last element in path as key of the child memento
|
||||
m.putString(path[path.length-1], (String) fMap.get(key));
|
||||
// construct the string for the keys
|
||||
if(i>0)
|
||||
buffer.append(","); //$NON-NLS-1$
|
||||
buffer.append(key);
|
||||
}
|
||||
// save the keys we have used.
|
||||
memento.putString(KEYS, buffer.toString());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
||||
|
||||
public class TerminalPreferenceInitializer extends AbstractPreferenceInitializer {
|
||||
|
||||
public TerminalPreferenceInitializer() {
|
||||
}
|
||||
|
||||
public void initializeDefaultPreferences() {
|
||||
Preferences store = TerminalViewPlugin.getDefault().getPluginPreferences();
|
||||
store.setDefault(TerminalPreferencePage.PREF_LIMITOUTPUT, TerminalPreferencePage.DEFAULT_LIMITOUTPUT);
|
||||
store.setDefault(TerminalPreferencePage.PREF_BUFFERLINES, TerminalPreferencePage.DEFAULT_BUFFERLINES);
|
||||
store.setDefault(TerminalPreferencePage.PREF_TIMEOUT_SERIAL, TerminalPreferencePage.DEFAULT_TIMEOUT_SERIAL);
|
||||
store.setDefault(TerminalPreferencePage.PREF_TIMEOUT_NETWORK, TerminalPreferencePage.DEFAULT_TIMEOUT_NETWORK);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,154 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.preference.IntegerFieldEditor;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
|
||||
public class TerminalPreferencePage extends FieldEditorPreferencePage implements
|
||||
IWorkbenchPreferencePage {
|
||||
public static final String PREF_LIMITOUTPUT = "TerminalPrefLimitOutput"; //$NON-NLS-1$
|
||||
public static final String PREF_BUFFERLINES = "TerminalPrefBufferLines"; //$NON-NLS-1$
|
||||
public static final String PREF_TIMEOUT_SERIAL = "TerminalPrefTimeoutSerial"; //$NON-NLS-1$
|
||||
public static final String PREF_TIMEOUT_NETWORK = "TerminalPrefTimeoutNetwork"; //$NON-NLS-1$
|
||||
public static final boolean DEFAULT_LIMITOUTPUT = true;
|
||||
public static final int DEFAULT_BUFFERLINES = 1000;
|
||||
public static final int DEFAULT_TIMEOUT_SERIAL = 5;
|
||||
public static final int DEFAULT_TIMEOUT_NETWORK = 5;
|
||||
|
||||
|
||||
protected TerminalBooleanFieldEditor fEditorLimitOutput;
|
||||
|
||||
protected IntegerFieldEditor fEditorBufferSize;
|
||||
|
||||
protected IntegerFieldEditor fEditorSerialTimeout;
|
||||
|
||||
protected IntegerFieldEditor fEditorNetworkTimeout;
|
||||
public TerminalPreferencePage() {
|
||||
super(GRID);
|
||||
}
|
||||
public void onLimitOutputSelected() {
|
||||
Button ctlButton;
|
||||
Text ctlText;
|
||||
Label ctlLabel;
|
||||
boolean bEnabled;
|
||||
|
||||
ctlButton = fEditorLimitOutput.getChangeControl(getFieldEditorParent());
|
||||
ctlText = fEditorBufferSize.getTextControl(getFieldEditorParent());
|
||||
ctlLabel = fEditorBufferSize.getLabelControl(getFieldEditorParent());
|
||||
bEnabled = ctlButton.getSelection();
|
||||
|
||||
ctlText.setEnabled(bEnabled);
|
||||
ctlLabel.setEnabled(bEnabled);
|
||||
}
|
||||
protected void createFieldEditors() {
|
||||
setupPage();
|
||||
}
|
||||
protected void initialize() {
|
||||
super.initialize();
|
||||
|
||||
onLimitOutputSelected();
|
||||
}
|
||||
protected void performDefaults() {
|
||||
super.performDefaults();
|
||||
|
||||
onLimitOutputSelected();
|
||||
}
|
||||
public void init(IWorkbench workbench) {
|
||||
// do nothing
|
||||
}
|
||||
protected void setupPage() {
|
||||
setupData();
|
||||
setupEditors();
|
||||
setupListeners();
|
||||
}
|
||||
protected void setupData() {
|
||||
TerminalViewPlugin plugin;
|
||||
IPreferenceStore preferenceStore;
|
||||
|
||||
plugin = TerminalViewPlugin.getDefault();
|
||||
preferenceStore = plugin.getPreferenceStore();
|
||||
setPreferenceStore(preferenceStore);
|
||||
}
|
||||
protected void setupEditors() {
|
||||
fEditorLimitOutput = new TerminalBooleanFieldEditor(
|
||||
PREF_LIMITOUTPUT, ViewMessages.LIMITOUTPUT,
|
||||
getFieldEditorParent());
|
||||
fEditorBufferSize = new IntegerFieldEditor(PREF_BUFFERLINES,
|
||||
ViewMessages.BUFFERLINES, getFieldEditorParent());
|
||||
fEditorSerialTimeout = new IntegerFieldEditor(
|
||||
PREF_TIMEOUT_SERIAL, ViewMessages.SERIALTIMEOUT,
|
||||
getFieldEditorParent());
|
||||
fEditorNetworkTimeout = new IntegerFieldEditor(
|
||||
PREF_TIMEOUT_NETWORK, ViewMessages.NETWORKTIMEOUT,
|
||||
getFieldEditorParent());
|
||||
|
||||
fEditorBufferSize.setValidRange(0, Integer.MAX_VALUE);
|
||||
fEditorSerialTimeout.setValidRange(0, Integer.MAX_VALUE);
|
||||
fEditorNetworkTimeout.setValidRange(0, Integer.MAX_VALUE);
|
||||
|
||||
addField(fEditorLimitOutput);
|
||||
addField(fEditorBufferSize);
|
||||
addField(fEditorSerialTimeout);
|
||||
addField(fEditorNetworkTimeout);
|
||||
}
|
||||
protected void setupListeners() {
|
||||
TerminalSelectionHandler selectionHandler;
|
||||
Button ctlButton;
|
||||
|
||||
selectionHandler = new TerminalSelectionHandler();
|
||||
ctlButton = fEditorLimitOutput.getChangeControl(getFieldEditorParent());
|
||||
ctlButton.addSelectionListener(selectionHandler);
|
||||
}
|
||||
public class TerminalBooleanFieldEditor extends BooleanFieldEditor {
|
||||
public TerminalBooleanFieldEditor(String strName, String strLabel,
|
||||
Composite ctlParent) {
|
||||
super(strName, strLabel, ctlParent);
|
||||
}
|
||||
public Button getChangeControl(Composite parent) {
|
||||
return super.getChangeControl(parent);
|
||||
}
|
||||
}
|
||||
protected class TerminalSelectionHandler extends SelectionAdapter {
|
||||
protected TerminalSelectionHandler() {
|
||||
super();
|
||||
}
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
Object source;
|
||||
Button ctlButton;
|
||||
|
||||
source = event.getSource();
|
||||
ctlButton = fEditorLimitOutput
|
||||
.getChangeControl(getFieldEditorParent());
|
||||
|
||||
if (source == ctlButton) {
|
||||
onLimitOutputSelected();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogSettings;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.tm.terminal.ISettingsPage;
|
||||
import org.eclipse.tm.terminal.ITerminalConnector;
|
||||
|
||||
class TerminalSettingsDlg extends Dialog {
|
||||
private Combo fCtlConnTypeCombo;
|
||||
private final ITerminalConnector[] fConnectors;
|
||||
private final ISettingsPage[] fPages;
|
||||
private int fSelectedConnector;
|
||||
private PageBook fPageBook;
|
||||
private IDialogSettings fDialogSettings;
|
||||
|
||||
public TerminalSettingsDlg(Shell shell, ITerminalConnector[] connectors, ITerminalConnector connector) {
|
||||
super(shell);
|
||||
fConnectors=connectors;
|
||||
fPages=new ISettingsPage[fConnectors.length];
|
||||
for (int i = 0; i < fConnectors.length; i++) {
|
||||
fPages[i]=fConnectors[i].makeSettingsPage();
|
||||
if(fConnectors[i]==connector)
|
||||
fSelectedConnector=i;
|
||||
}
|
||||
}
|
||||
protected void okPressed() {
|
||||
if (!validateSettings())
|
||||
return;
|
||||
if(fSelectedConnector>=0) {
|
||||
fPages[fSelectedConnector].saveSettings();
|
||||
}
|
||||
super.okPressed();
|
||||
}
|
||||
protected void cancelPressed() {
|
||||
fSelectedConnector=-1;
|
||||
super.cancelPressed();
|
||||
}
|
||||
public int open() {
|
||||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||
return super.open();
|
||||
}
|
||||
protected void configureShell(Shell newShell) {
|
||||
super.configureShell(newShell);
|
||||
|
||||
newShell.setText(ViewMessages.TERMINALSETTINGS);
|
||||
}
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite ctlComposite = (Composite) super.createDialogArea(parent);
|
||||
setupPanel(ctlComposite);
|
||||
setupListeners();
|
||||
initFields();
|
||||
|
||||
return ctlComposite;
|
||||
}
|
||||
private void initFields() {
|
||||
// Load controls
|
||||
for (int i = 0; i < fPages.length; i++) {
|
||||
String name=fPages[i].getName();
|
||||
fCtlConnTypeCombo.add(name);
|
||||
if(fSelectedConnector==i) {
|
||||
fCtlConnTypeCombo.select(i);
|
||||
selectPage(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
private boolean validateSettings() {
|
||||
if(fSelectedConnector<0)
|
||||
return true;
|
||||
return fPages[fSelectedConnector].validateSettings();
|
||||
}
|
||||
private void setupPanel(Composite wndParent) {
|
||||
setupConnTypePanel(wndParent);
|
||||
setupSettingsGroup(wndParent);
|
||||
}
|
||||
private void setupConnTypePanel(Composite wndParent) {
|
||||
Group wndGroup;
|
||||
GridLayout gridLayout;
|
||||
GridData gridData;
|
||||
|
||||
wndGroup = new Group(wndParent, SWT.NONE);
|
||||
gridLayout = new GridLayout(1, true);
|
||||
gridData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
|
||||
wndGroup.setLayout(gridLayout);
|
||||
wndGroup.setLayoutData(gridData);
|
||||
wndGroup.setText(ViewMessages.CONNECTIONTYPE + ":"); //$NON-NLS-1$
|
||||
|
||||
fCtlConnTypeCombo = new Combo(wndGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||
gridData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gridData.widthHint = 200;
|
||||
fCtlConnTypeCombo.setLayoutData(gridData);
|
||||
}
|
||||
private void setupSettingsGroup(Composite parent) {
|
||||
Group group = new Group(parent, SWT.NONE);
|
||||
group.setText(ViewMessages.SETTINGS + ":"); //$NON-NLS-1$
|
||||
group.setLayout(new GridLayout());
|
||||
group.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
fPageBook=new PageBook(group,SWT.NONE);
|
||||
fPageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
|
||||
for (int i = 0; i < fPages.length; i++) {
|
||||
fPages[i].createControl(fPageBook);
|
||||
}
|
||||
}
|
||||
private void setupListeners() {
|
||||
fCtlConnTypeCombo.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
selectPage(fCtlConnTypeCombo.getSelectionIndex());
|
||||
}
|
||||
});
|
||||
}
|
||||
public ITerminalConnector getConnector() {
|
||||
if(fSelectedConnector>=0)
|
||||
return fConnectors[fSelectedConnector];
|
||||
return null;
|
||||
}
|
||||
private void selectPage(int index) {
|
||||
fSelectedConnector=index;
|
||||
Control[] pages=fPageBook.getChildren();
|
||||
fPageBook.showPage(pages[fSelectedConnector]);
|
||||
}
|
||||
protected IDialogSettings getDialogBoundsSettings() {
|
||||
IDialogSettings ds=TerminalViewPlugin.getDefault().getDialogSettings();
|
||||
fDialogSettings = ds.getSection(getClass().getName());
|
||||
if (fDialogSettings == null) {
|
||||
fDialogSettings = ds.addNewSection(getClass().getName());
|
||||
}
|
||||
return fDialogSettings;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,627 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
import org.eclipse.jface.action.ActionContributionItem;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.IToolBarManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.jface.window.ApplicationWindow;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.dnd.TextTransfer;
|
||||
import org.eclipse.swt.events.MenuEvent;
|
||||
import org.eclipse.swt.events.MenuListener;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalAction;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionClearAll;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionConnect;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionCopy;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionCut;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionDisconnect;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionNewTerminal;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionPaste;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionSelectAll;
|
||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionSettings;
|
||||
import org.eclipse.tm.internal.terminal.control.ITerminalListener;
|
||||
import org.eclipse.tm.internal.terminal.control.ITerminalViewControl;
|
||||
import org.eclipse.tm.internal.terminal.control.TerminalViewControlFactory;
|
||||
import org.eclipse.tm.terminal.ISettingsStore;
|
||||
import org.eclipse.tm.terminal.ITerminalConnector;
|
||||
import org.eclipse.tm.terminal.Logger;
|
||||
import org.eclipse.tm.terminal.TerminalConnectorExtension;
|
||||
import org.eclipse.tm.terminal.TerminalState;
|
||||
import org.eclipse.ui.IActionBars;
|
||||
import org.eclipse.ui.IMemento;
|
||||
import org.eclipse.ui.IViewSite;
|
||||
import org.eclipse.ui.IWorkbenchActionConstants;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.actions.ActionFactory;
|
||||
import org.eclipse.ui.actions.RetargetAction;
|
||||
import org.eclipse.ui.part.ViewPart;
|
||||
|
||||
public class TerminalView extends ViewPart implements ITerminalView, ITerminalListener {
|
||||
public static final String FONT_DEFINITION = "terminal.views.view.font.definition"; //$NON-NLS-1$
|
||||
|
||||
protected ITerminalViewControl fCtlTerminal;
|
||||
|
||||
protected TerminalAction fActionTerminalNewTerminal;
|
||||
|
||||
protected TerminalAction fActionTerminalConnect;
|
||||
|
||||
protected TerminalAction fActionTerminalDisconnect;
|
||||
|
||||
protected TerminalAction fActionTerminalSettings;
|
||||
|
||||
protected TerminalAction fActionEditCopy;
|
||||
|
||||
protected TerminalAction fActionEditCut;
|
||||
|
||||
protected TerminalAction fActionEditPaste;
|
||||
|
||||
protected TerminalAction fActionEditClearAll;
|
||||
|
||||
protected TerminalAction fActionEditSelectAll;
|
||||
|
||||
protected TerminalMenuHandlerEdit fMenuHandlerEdit;
|
||||
|
||||
protected TerminalPropertyChangeHandler fPropertyChangeHandler;
|
||||
|
||||
protected boolean fMenuAboutToShow;
|
||||
|
||||
private SettingsStore fStore;
|
||||
|
||||
public TerminalView() {
|
||||
Logger
|
||||
.log("==============================================================="); //$NON-NLS-1$
|
||||
}
|
||||
// TODO MSA
|
||||
// private void XXXXX() {
|
||||
// Preferences preferences = TerminalViewPlugin.getDefault().getPluginPreferences();
|
||||
// boolean bLimitOutput = preferences.getBoolean(TerminalPreferencePage.PREF_LIMITOUTPUT);
|
||||
// int bufferLineLimit = preferences.getInt(TerminalPreferencePage.PREF_BUFFERLINES);
|
||||
//
|
||||
// }
|
||||
// TerminalTarget interface
|
||||
public void setState(final TerminalState state) {
|
||||
Runnable runnable=new Runnable() {
|
||||
public void run() {
|
||||
updateStatus();
|
||||
onTerminalStatus();
|
||||
}
|
||||
};
|
||||
if(Thread.currentThread()==Display.getDefault().getThread())
|
||||
runnable.run();
|
||||
else
|
||||
Display.getDefault().syncExec(runnable);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display a new Terminal view. This method is called when the user clicks the New
|
||||
* Terminal button in any Terminal view's toolbar.
|
||||
*/
|
||||
public void onTerminalNewTerminal() {
|
||||
Logger.log("creating new Terminal instance."); //$NON-NLS-1$
|
||||
|
||||
try {
|
||||
// The second argument to showView() is a unique String identifying the
|
||||
// secondary view instance. If it ever matches a previously used secondary
|
||||
// view identifier, then this call will not create a new Terminal view,
|
||||
// which is undesireable. Therefore, we append the current time in
|
||||
// milliseconds to the secondary view identifier to ensure it is always
|
||||
// unique. This code runs only when the user clicks the New Terminal
|
||||
// button, so there is no risk that this code will run twice in a single
|
||||
// millisecond.
|
||||
|
||||
getSite().getPage().showView(
|
||||
"org.eclipse.tm.terminal.view.TerminalView",//$NON-NLS-1$
|
||||
"SecondaryTerminal" + System.currentTimeMillis(), //$NON-NLS-1$
|
||||
IWorkbenchPage.VIEW_ACTIVATE);
|
||||
} catch (PartInitException ex) {
|
||||
Logger.logException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void onTerminalConnect() {
|
||||
if (isConnected())
|
||||
return;
|
||||
if(fCtlTerminal.getTerminalConnection()==null)
|
||||
setConnector(showSettingsDialog());
|
||||
fCtlTerminal.connectTerminal();
|
||||
}
|
||||
|
||||
public void updateStatus() {
|
||||
updateTerminalConnect();
|
||||
updateTerminalDisconnect();
|
||||
updateTerminalSettings();
|
||||
}
|
||||
|
||||
public void updateTerminalConnect() {
|
||||
boolean bEnabled = ((!isConnecting()) && (!fCtlTerminal.isConnected()));
|
||||
|
||||
fActionTerminalConnect.setEnabled(bEnabled);
|
||||
}
|
||||
|
||||
private boolean isConnecting() {
|
||||
return fCtlTerminal.getState()==TerminalState.CONNECTING;
|
||||
}
|
||||
private boolean isConnected() {
|
||||
return fCtlTerminal.getState()==TerminalState.CONNECTED;
|
||||
}
|
||||
public void onTerminalDisconnect() {
|
||||
fCtlTerminal.disconnectTerminal();
|
||||
}
|
||||
|
||||
public void updateTerminalDisconnect() {
|
||||
boolean bEnabled = ((isConnecting()) || (fCtlTerminal.isConnected()));
|
||||
fActionTerminalDisconnect.setEnabled(bEnabled);
|
||||
}
|
||||
|
||||
public void onTerminalSettings() {
|
||||
ITerminalConnector c=showSettingsDialog();
|
||||
if(c!=null) {
|
||||
setConnector(c);
|
||||
|
||||
onTerminalConnect();
|
||||
}
|
||||
}
|
||||
|
||||
private ITerminalConnector showSettingsDialog() {
|
||||
// When the settings dialog is opened, load the Terminal settings from the
|
||||
// persistent settings.
|
||||
|
||||
TerminalSettingsDlg dlgTerminalSettings = new TerminalSettingsDlg(getViewSite().getShell(),fCtlTerminal.getConnectors(),fCtlTerminal.getTerminalConnection());
|
||||
|
||||
Logger.log("opening Settings dialog."); //$NON-NLS-1$
|
||||
|
||||
if (dlgTerminalSettings.open() == Window.CANCEL) {
|
||||
Logger.log("Settings dialog cancelled."); //$NON-NLS-1$
|
||||
return null;
|
||||
}
|
||||
|
||||
Logger.log("Settings dialog OK'ed."); //$NON-NLS-1$
|
||||
|
||||
// When the settings dialog is closed, we persist the Terminal settings.
|
||||
|
||||
saveSettings(dlgTerminalSettings.getConnector());
|
||||
return dlgTerminalSettings.getConnector();
|
||||
}
|
||||
|
||||
private void setConnector(ITerminalConnector connector) {
|
||||
fCtlTerminal.setConnector(connector);
|
||||
}
|
||||
|
||||
public void updateTerminalSettings() {
|
||||
boolean bEnabled;
|
||||
|
||||
bEnabled = ((!isConnecting()) && (!fCtlTerminal
|
||||
.isConnected()));
|
||||
|
||||
fActionTerminalSettings.setEnabled(bEnabled);
|
||||
}
|
||||
|
||||
public void setTerminalTitle(String strTitle) {
|
||||
if (fCtlTerminal.isDisposed())
|
||||
return;
|
||||
|
||||
if (strTitle != null) {
|
||||
// When parameter 'data' is not null, it is a String containing text to
|
||||
// display in the view's content description line. This is used by class
|
||||
// TerminalText when it processes an ANSI OSC escape sequence that commands
|
||||
// the terminal to display text in its title bar.
|
||||
} else {
|
||||
// When parameter 'data' is null, we construct a descriptive string to
|
||||
// display in the content description line.
|
||||
String strConnected = getStateDisplayName(fCtlTerminal.getState());
|
||||
String status=""; //$NON-NLS-1$
|
||||
status=fCtlTerminal.getStatusString(strConnected);
|
||||
strTitle = ViewMessages.PROP_TITLE + status;
|
||||
}
|
||||
|
||||
setContentDescription(strTitle);
|
||||
getViewSite().getActionBars().getStatusLineManager().setMessage(
|
||||
strTitle);
|
||||
}
|
||||
public void onTerminalStatus() {
|
||||
setTerminalTitle(null);
|
||||
}
|
||||
|
||||
private String getStateDisplayName(TerminalState state) {
|
||||
if(state==TerminalState.CONNECTED) {
|
||||
return ViewMessages.STATE_CONNECTED;
|
||||
} else if(state==TerminalState.CONNECTING) {
|
||||
return ViewMessages.STATE_CONNECTING;
|
||||
} else if(state==TerminalState.OPENED) {
|
||||
return ViewMessages.STATE_OPENED;
|
||||
} else if(state==TerminalState.CLOSED) {
|
||||
return ViewMessages.STATE_CLOSED;
|
||||
} else {
|
||||
throw new IllegalStateException(state.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void onTerminalFontChanged() {
|
||||
fCtlTerminal.getCtlText().setFont(JFaceResources.getFont(FONT_DEFINITION));
|
||||
|
||||
// Tell the TerminalControl singleton that the font has changed.
|
||||
|
||||
fCtlTerminal.onFontChanged();
|
||||
}
|
||||
|
||||
public void onEditCopy() {
|
||||
String selection=fCtlTerminal.getSelection();
|
||||
|
||||
if (!selection.equals("")) {//$NON-NLS-1$
|
||||
fCtlTerminal.copy();
|
||||
} else {
|
||||
fCtlTerminal.sendKey('\u0003');
|
||||
}
|
||||
}
|
||||
|
||||
public void updateEditCopy() {
|
||||
boolean bEnabled=true;
|
||||
|
||||
if (fMenuAboutToShow) {
|
||||
bEnabled = fCtlTerminal.getSelection().length()>0;
|
||||
}
|
||||
|
||||
fActionEditCopy.setEnabled(bEnabled);
|
||||
}
|
||||
|
||||
public void onEditCut() {
|
||||
fCtlTerminal.sendKey('\u0018');
|
||||
}
|
||||
|
||||
public void updateEditCut() {
|
||||
boolean bEnabled;
|
||||
|
||||
bEnabled = !fMenuAboutToShow;
|
||||
fActionEditCut.setEnabled(bEnabled);
|
||||
}
|
||||
|
||||
public void onEditPaste() {
|
||||
fCtlTerminal.paste();
|
||||
}
|
||||
|
||||
public void updateEditPaste() {
|
||||
String strText = (String) fCtlTerminal.getClipboard().getContents(TextTransfer.getInstance());
|
||||
|
||||
boolean bEnabled = ((strText != null) && (!strText.equals("")) && (isConnected()));//$NON-NLS-1$
|
||||
|
||||
fActionEditPaste.setEnabled(bEnabled);
|
||||
}
|
||||
|
||||
public void onEditClearAll() {
|
||||
fCtlTerminal.clearTerminal();
|
||||
}
|
||||
|
||||
public void updateEditClearAll() {
|
||||
fActionEditClearAll.setEnabled(!fCtlTerminal.isEmpty());
|
||||
}
|
||||
|
||||
public void onEditSelectAll() {
|
||||
fCtlTerminal.selectAll();
|
||||
}
|
||||
|
||||
public void updateEditSelectAll() {
|
||||
fActionEditSelectAll.setEnabled(!fCtlTerminal.isEmpty());
|
||||
}
|
||||
|
||||
// ViewPart interface
|
||||
|
||||
public void createPartControl(Composite wndParent) {
|
||||
// Bind plugin.xml key bindings to this plugin. Overrides global Control-W key
|
||||
// sequence.
|
||||
|
||||
setPartName(ViewMessages.PROP_TITLE);
|
||||
|
||||
setupControls(wndParent);
|
||||
setupActions();
|
||||
setupMenus();
|
||||
setupLocalToolBars();
|
||||
setupContextMenus();
|
||||
setupListeners(wndParent);
|
||||
|
||||
onTerminalStatus();
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
Logger.log("entered."); //$NON-NLS-1$
|
||||
|
||||
setPartName("Terminal"); //$NON-NLS-1$
|
||||
|
||||
|
||||
JFaceResources.getFontRegistry().removeListener(fPropertyChangeHandler);
|
||||
MenuManager menuMgr = getEditMenuManager();
|
||||
Menu menu = menuMgr.getMenu();
|
||||
|
||||
menuMgr.removeMenuListener(fMenuHandlerEdit);
|
||||
|
||||
if (menu != null)
|
||||
menu.removeMenuListener(fMenuHandlerEdit);
|
||||
|
||||
fCtlTerminal.disposeTerminal();
|
||||
}
|
||||
/**
|
||||
* Passing the focus request to the viewer's control.
|
||||
*/
|
||||
public void setFocus() {
|
||||
fCtlTerminal.setFocus();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method creates the top-level control for the Terminal view.
|
||||
*/
|
||||
protected void setupControls(Composite wndParent) {
|
||||
ITerminalConnector[] connectors=TerminalConnectorExtension.getTerminalConnectors();
|
||||
fCtlTerminal = TerminalViewControlFactory.makeControl(this, wndParent, connectors);
|
||||
String connectionType=fStore.get("ConnectionType"); //$NON-NLS-1$
|
||||
for (int i = 0; i < connectors.length; i++) {
|
||||
connectors[i].load(getStore(connectors[i]));
|
||||
if(connectors[i].getId().equals(connectionType))
|
||||
fCtlTerminal.setConnector(connectors[i]);
|
||||
}
|
||||
}
|
||||
private void saveSettings(ITerminalConnector connector) {
|
||||
ITerminalConnector[] connectors=fCtlTerminal.getConnectors();
|
||||
for (int i = 0; i < connectors.length; i++) {
|
||||
connectors[i].save(getStore(connectors[i]));
|
||||
}
|
||||
if(connector!=null) {
|
||||
fStore.put("ConnectionType",connector.getId()); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
public void init(IViewSite site, IMemento memento) throws PartInitException {
|
||||
super.init(site, memento);
|
||||
fStore=new SettingsStore(memento);
|
||||
}
|
||||
|
||||
public void saveState(IMemento memento) {
|
||||
super.saveState(memento);
|
||||
fStore.saveState(memento);
|
||||
}
|
||||
private ISettingsStore getStore(ITerminalConnector connector) {
|
||||
return new SettingStorePrefixDecorator(fStore,connector.getClass().getName()+"."); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected void setupActions() {
|
||||
fActionTerminalNewTerminal = new TerminalActionNewTerminal(this);
|
||||
fActionTerminalConnect = new TerminalActionConnect(this);
|
||||
fActionTerminalDisconnect = new TerminalActionDisconnect(this);
|
||||
fActionTerminalSettings = new TerminalActionSettings(this);
|
||||
fActionEditCopy = new TerminalActionCopy(this);
|
||||
fActionEditCut = new TerminalActionCut(this);
|
||||
fActionEditPaste = new TerminalActionPaste(this);
|
||||
fActionEditClearAll = new TerminalActionClearAll(this);
|
||||
fActionEditSelectAll = new TerminalActionSelectAll(this);
|
||||
|
||||
IActionBars actionBars = getViewSite().getActionBars();
|
||||
actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), fActionEditCopy);
|
||||
|
||||
actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), fActionEditCut);
|
||||
|
||||
actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), fActionEditPaste);
|
||||
|
||||
actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), fActionEditSelectAll);
|
||||
}
|
||||
|
||||
protected void setupMenus() {
|
||||
MenuManager menuMgr = getEditMenuManager();
|
||||
Menu menu = menuMgr.getMenu();
|
||||
|
||||
fMenuHandlerEdit = new TerminalMenuHandlerEdit();
|
||||
menuMgr.addMenuListener(fMenuHandlerEdit);
|
||||
menu.addMenuListener(fMenuHandlerEdit);
|
||||
}
|
||||
/**
|
||||
* @return the Edit Menu
|
||||
*/
|
||||
private MenuManager getEditMenuManager() {
|
||||
ApplicationWindow workbenchWindow = (ApplicationWindow) TerminalViewPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
|
||||
MenuManager menuMgr = workbenchWindow.getMenuBarManager();
|
||||
menuMgr = (MenuManager) menuMgr.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
|
||||
return menuMgr;
|
||||
}
|
||||
|
||||
|
||||
protected void setupLocalToolBars() {
|
||||
IToolBarManager toolBarMgr = getViewSite().getActionBars().getToolBarManager();
|
||||
|
||||
toolBarMgr.add(fActionTerminalNewTerminal);
|
||||
toolBarMgr.add(fActionTerminalConnect);
|
||||
toolBarMgr.add(fActionTerminalDisconnect);
|
||||
toolBarMgr.add(fActionTerminalSettings);
|
||||
}
|
||||
|
||||
protected void setupContextMenus() {
|
||||
StyledText ctlText;
|
||||
MenuManager menuMgr;
|
||||
Menu menu;
|
||||
TerminalContextMenuHandler contextMenuHandler;
|
||||
|
||||
ctlText = fCtlTerminal.getCtlText();
|
||||
menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
|
||||
menu = menuMgr.createContextMenu(ctlText);
|
||||
contextMenuHandler = new TerminalContextMenuHandler();
|
||||
|
||||
ctlText.setMenu(menu);
|
||||
menuMgr.setRemoveAllWhenShown(true);
|
||||
menuMgr.addMenuListener(contextMenuHandler);
|
||||
menu.addMenuListener(contextMenuHandler);
|
||||
}
|
||||
|
||||
protected void loadContextMenus(IMenuManager menuMgr) {
|
||||
menuMgr.add(fActionEditCopy);
|
||||
menuMgr.add(fActionEditPaste);
|
||||
menuMgr.add(new Separator());
|
||||
menuMgr.add(fActionEditClearAll);
|
||||
menuMgr.add(fActionEditSelectAll);
|
||||
|
||||
// Other plug-ins can contribute there actions here
|
||||
menuMgr.add(new Separator("Additions")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected void setupListeners(Composite wndParent) {
|
||||
fPropertyChangeHandler = new TerminalPropertyChangeHandler();
|
||||
JFaceResources.getFontRegistry().addListener(fPropertyChangeHandler);
|
||||
}
|
||||
|
||||
// Inner classes
|
||||
|
||||
/**
|
||||
* Because it is too expensive to update the cut/copy/pase/selectAll actions
|
||||
* each time the selection in the terminal view has changed, we update them,
|
||||
* when the menu is shown.
|
||||
* <p>
|
||||
* TODO: this might be dangerous because those actions might be shown in the toolbar
|
||||
* and might not update...
|
||||
*
|
||||
*/
|
||||
protected class TerminalMenuHandlerEdit implements MenuListener, IMenuListener {
|
||||
protected String fActionDefinitionIdCopy;
|
||||
|
||||
protected String fActionDefinitionIdPaste;
|
||||
|
||||
protected String fActionDefinitionIdSelectAll;
|
||||
|
||||
protected int fAcceleratorCopy;
|
||||
|
||||
protected int fAcceleratorPaste;
|
||||
|
||||
protected int fAcceleratorSelectAll;
|
||||
|
||||
protected TerminalMenuHandlerEdit() {
|
||||
super();
|
||||
|
||||
fActionDefinitionIdCopy = ""; //$NON-NLS-1$
|
||||
fActionDefinitionIdPaste = ""; //$NON-NLS-1$
|
||||
fActionDefinitionIdSelectAll = ""; //$NON-NLS-1$
|
||||
|
||||
fAcceleratorCopy = 0;
|
||||
fAcceleratorPaste = 0;
|
||||
fAcceleratorSelectAll = 0;
|
||||
}
|
||||
public void menuAboutToShow(IMenuManager menuMgr) {
|
||||
|
||||
fMenuAboutToShow = true;
|
||||
updateEditCopy();
|
||||
updateEditCut();
|
||||
updateEditPaste();
|
||||
updateEditSelectAll();
|
||||
|
||||
ActionContributionItem item = (ActionContributionItem) menuMgr.find(ActionFactory.COPY.getId());
|
||||
RetargetAction action = (RetargetAction) item.getAction();
|
||||
fActionDefinitionIdCopy = action.getActionDefinitionId();
|
||||
fAcceleratorCopy = action.getAccelerator();
|
||||
action.setActionDefinitionId(null);
|
||||
action.enableAccelerator(false);
|
||||
item.update();
|
||||
|
||||
item = (ActionContributionItem) menuMgr.find(ActionFactory.PASTE.getId());
|
||||
action = (RetargetAction) item.getAction();
|
||||
fActionDefinitionIdPaste = action.getActionDefinitionId();
|
||||
fAcceleratorPaste = action.getAccelerator();
|
||||
action.setActionDefinitionId(null);
|
||||
action.enableAccelerator(false);
|
||||
item.update();
|
||||
|
||||
item = (ActionContributionItem) menuMgr.find(ActionFactory.SELECT_ALL.getId());
|
||||
action = (RetargetAction) item.getAction();
|
||||
fActionDefinitionIdSelectAll = action.getActionDefinitionId();
|
||||
fAcceleratorSelectAll = action.getAccelerator();
|
||||
action.setActionDefinitionId(null);
|
||||
action.enableAccelerator(false);
|
||||
item.update();
|
||||
}
|
||||
public void menuShown(MenuEvent event) {
|
||||
// do nothing
|
||||
}
|
||||
public void menuHidden(MenuEvent event) {
|
||||
MenuManager menuMgr;
|
||||
ActionContributionItem item;
|
||||
RetargetAction action;
|
||||
|
||||
fMenuAboutToShow = false;
|
||||
updateEditCopy();
|
||||
updateEditCut();
|
||||
|
||||
menuMgr = getEditMenuManager();
|
||||
|
||||
item = (ActionContributionItem) menuMgr.find(ActionFactory.COPY
|
||||
.getId());
|
||||
action = (RetargetAction) item.getAction();
|
||||
action.setActionDefinitionId(fActionDefinitionIdCopy);
|
||||
action.setAccelerator(fAcceleratorCopy);
|
||||
action.enableAccelerator(true);
|
||||
item.update();
|
||||
|
||||
item = (ActionContributionItem) menuMgr.find(ActionFactory.PASTE
|
||||
.getId());
|
||||
action = (RetargetAction) item.getAction();
|
||||
action.setActionDefinitionId(fActionDefinitionIdPaste);
|
||||
action.setAccelerator(fAcceleratorPaste);
|
||||
action.enableAccelerator(true);
|
||||
item.update();
|
||||
|
||||
item = (ActionContributionItem) menuMgr
|
||||
.find(ActionFactory.SELECT_ALL.getId());
|
||||
action = (RetargetAction) item.getAction();
|
||||
action.setActionDefinitionId(fActionDefinitionIdSelectAll);
|
||||
action.setAccelerator(fAcceleratorSelectAll);
|
||||
action.enableAccelerator(true);
|
||||
item.update();
|
||||
}
|
||||
}
|
||||
|
||||
protected class TerminalContextMenuHandler implements MenuListener, IMenuListener {
|
||||
public void menuHidden(MenuEvent event) {
|
||||
fMenuAboutToShow = false;
|
||||
updateEditCopy();
|
||||
}
|
||||
|
||||
public void menuShown(MenuEvent e) {
|
||||
//
|
||||
}
|
||||
public void menuAboutToShow(IMenuManager menuMgr) {
|
||||
fMenuAboutToShow = true;
|
||||
updateEditCopy();
|
||||
updateEditCut();
|
||||
updateEditPaste();
|
||||
updateEditClearAll();
|
||||
|
||||
loadContextMenus(menuMgr);
|
||||
}
|
||||
}
|
||||
|
||||
protected class TerminalPropertyChangeHandler implements IPropertyChangeListener {
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
if (event.getProperty().equals(FONT_DEFINITION)) {
|
||||
onTerminalFontChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.tm.terminal.Logger;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
public class TerminalViewPlugin extends AbstractUIPlugin {
|
||||
protected static TerminalViewPlugin fDefault;
|
||||
public static final String PLUGIN_HOME = "org.eclipse.tm.terminal"; //$NON-NLS-1$
|
||||
public static final String HELP_VIEW = PLUGIN_HOME + ".terminal_view"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*/
|
||||
public TerminalViewPlugin() {
|
||||
fDefault = this;
|
||||
}
|
||||
protected void initializeImageRegistry(ImageRegistry imageRegistry) {
|
||||
HashMap map;
|
||||
|
||||
map = new HashMap();
|
||||
|
||||
try {
|
||||
// Local toolbars
|
||||
map.put(ImageConsts.IMAGE_NEW_TERMINAL, "newterminal.gif"); //$NON-NLS-1$
|
||||
map.put(ImageConsts.IMAGE_CLCL_CONNECT, "connect_co.gif"); //$NON-NLS-1$
|
||||
map.put(ImageConsts.IMAGE_CLCL_DISCONNECT, "disconnect_co.gif"); //$NON-NLS-1$
|
||||
map.put(ImageConsts.IMAGE_CLCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$
|
||||
|
||||
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_LOCALTOOL, map);
|
||||
|
||||
map.clear();
|
||||
|
||||
// Enabled local toolbars
|
||||
map.put(ImageConsts.IMAGE_NEW_TERMINAL, "newterminal.gif"); //$NON-NLS-1$
|
||||
map.put(ImageConsts.IMAGE_ELCL_CONNECT, "connect_co.gif"); //$NON-NLS-1$
|
||||
map.put(ImageConsts.IMAGE_ELCL_DISCONNECT, "disconnect_co.gif"); //$NON-NLS-1$
|
||||
map.put(ImageConsts.IMAGE_ELCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$
|
||||
|
||||
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_ELCL, map);
|
||||
|
||||
map.clear();
|
||||
|
||||
// Disabled local toolbars
|
||||
map.put(ImageConsts.IMAGE_NEW_TERMINAL, "newterminal.gif"); //$NON-NLS-1$
|
||||
map.put(ImageConsts.IMAGE_DLCL_CONNECT, "connect_co.gif"); //$NON-NLS-1$
|
||||
map.put(ImageConsts.IMAGE_DLCL_DISCONNECT, "disconnect_co.gif"); //$NON-NLS-1$
|
||||
map.put(ImageConsts.IMAGE_DLCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$
|
||||
|
||||
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_DLCL, map);
|
||||
|
||||
map.clear();
|
||||
} catch (MalformedURLException malformedURLException) {
|
||||
malformedURLException.printStackTrace();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the shared instance.
|
||||
*/
|
||||
public static TerminalViewPlugin getDefault() {
|
||||
return fDefault;
|
||||
}
|
||||
|
||||
public static boolean isLogInfoEnabled() {
|
||||
return isOptionEnabled(Logger.TRACE_DEBUG_LOG_INFO);
|
||||
}
|
||||
public static boolean isLogErrorEnabled() {
|
||||
return isOptionEnabled(Logger.TRACE_DEBUG_LOG_ERROR);
|
||||
}
|
||||
public static boolean isLogEnabled() {
|
||||
return isOptionEnabled(Logger.TRACE_DEBUG_LOG);
|
||||
}
|
||||
|
||||
public static boolean isOptionEnabled(String strOption) {
|
||||
String strEnabled;
|
||||
Boolean boolEnabled;
|
||||
boolean bEnabled;
|
||||
|
||||
strEnabled = Platform.getDebugOption(strOption);
|
||||
if (strEnabled == null)
|
||||
return false;
|
||||
|
||||
boolEnabled = new Boolean(strEnabled);
|
||||
bEnabled = boolEnabled.booleanValue();
|
||||
|
||||
return bEnabled;
|
||||
}
|
||||
protected void loadImageRegistry(ImageRegistry imageRegistry,
|
||||
String strDir, HashMap map) throws MalformedURLException {
|
||||
URL url;
|
||||
ImageDescriptor imageDescriptor;
|
||||
Iterator keys;
|
||||
String strKey;
|
||||
String strFile;
|
||||
|
||||
keys = map.keySet().iterator();
|
||||
|
||||
while (keys.hasNext()) {
|
||||
strKey = (String) keys.next();
|
||||
strFile = (String) map.get(strKey);
|
||||
|
||||
if (strFile != null) {
|
||||
url = TerminalViewPlugin.getDefault().getBundle().getEntry(
|
||||
ImageConsts.IMAGE_DIR_ROOT + strDir + strFile);
|
||||
imageDescriptor = ImageDescriptor.createFromURL(url);
|
||||
imageRegistry.put(strKey, imageDescriptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2006 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
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following Wind River employees contributed to the Terminal component
|
||||
* that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.view;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
public class ViewMessages extends NLS {
|
||||
static {
|
||||
NLS.initializeMessages(ViewMessages.class.getName(), ViewMessages.class);
|
||||
}
|
||||
public static String PROP_TITLE;
|
||||
public static String SETTINGS;
|
||||
|
||||
public static String TERMINALSETTINGS;
|
||||
public static String CONNECTIONTYPE;
|
||||
|
||||
public static String LIMITOUTPUT;
|
||||
public static String BUFFERLINES;
|
||||
public static String SERIALTIMEOUT;
|
||||
public static String NETWORKTIMEOUT;
|
||||
|
||||
public static String STATE_CONNECTED;
|
||||
public static String STATE_CONNECTING;
|
||||
public static String STATE_OPENED;
|
||||
public static String STATE_CLOSED;
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
###############################################################################
|
||||
# Copyright (c) 2003, 2006 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
|
||||
#
|
||||
# Initial Contributors:
|
||||
# The following Wind River employees contributed to the Terminal component
|
||||
# that contains this file: Chris Thew, Fran Litterio, Stephen Lamb,
|
||||
# Helmut Haigermoser and Ted Williams.
|
||||
#
|
||||
# Contributors:
|
||||
# Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
###############################################################################
|
||||
PROP_TITLE = Terminal
|
||||
SETTINGS = Settings
|
||||
|
||||
TERMINALSETTINGS = Terminal Settings
|
||||
CONNECTIONTYPE = Connection Type
|
||||
|
||||
LIMITOUTPUT = Limit terminal output
|
||||
BUFFERLINES = Terminal buffer lines:
|
||||
SERIALTIMEOUT = Serial timeout (seconds):
|
||||
NETWORKTIMEOUT = Network timeout (seconds):
|
||||
|
||||
STATE_CONNECTED = CONNECTED
|
||||
STATE_CONNECTING = CONNECTING...
|
||||
STATE_OPENED = OPENED
|
||||
STATE_CLOSED = CLOSED
|
|
@ -1,11 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
|
||||
<accessrules>
|
||||
<accessrule kind="discouraged" pattern="**/internal/**"/>
|
||||
</accessrules>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true
|
||||
Bundle-Version: 0.9.2.qualifier
|
||||
Bundle-Activator: org.eclipse.tm.terminal.internal.control.TerminalPlugin
|
||||
Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
|
@ -11,7 +11,7 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
Eclipse-LazyStart: true
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.4
|
||||
Bundle-ClassPath: .
|
||||
Export-Package: org.eclipse.tm.terminal,
|
||||
org.eclipse.tm.terminal.control,
|
||||
org.eclipse.tm.terminal.internal.control;x-internal:=true,
|
||||
org.eclipse.tm.terminal.internal.telnet;x-internal:=true
|
||||
Export-Package: org.eclipse.tm.internal.terminal.control;x-friends:="org.eclipse.tm.terminal.view",
|
||||
org.eclipse.tm.internal.terminal.control.impl;x-internal:=true,
|
||||
org.eclipse.tm.internal.terminal.telnet;x-internal:=true,
|
||||
org.eclipse.tm.terminal
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<extension-point id="terminalConnector" name="Terminal Connector" schema="schema/terminalConnector.exsd"/>
|
||||
<extension
|
||||
point="org.eclipse.tm.terminal.terminalConnector">
|
||||
<connector class="org.eclipse.tm.terminal.internal.telnet.TelnetConnector"/>
|
||||
<connector class="org.eclipse.tm.internal.terminal.telnet.TelnetConnector"/>
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.contexts">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.control;
|
||||
package org.eclipse.tm.internal.terminal.control;
|
||||
|
||||
import org.eclipse.tm.terminal.TerminalState;
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.control;
|
||||
package org.eclipse.tm.internal.terminal.control;
|
||||
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
|
@ -9,11 +9,11 @@
|
|||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.control;
|
||||
package org.eclipse.tm.internal.terminal.control;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.tm.internal.terminal.control.impl.TerminalControl;
|
||||
import org.eclipse.tm.terminal.ITerminalConnector;
|
||||
import org.eclipse.tm.terminal.internal.control.TerminalControl;
|
||||
|
||||
public class TerminalViewControlFactory {
|
||||
public static ITerminalViewControl makeControl(ITerminalListener target, Composite wndParent, ITerminalConnector[] connectors) {
|
|
@ -9,7 +9,7 @@
|
|||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.control;
|
||||
package org.eclipse.tm.internal.terminal.control.impl;
|
||||
|
||||
import java.io.OutputStream;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.control;
|
||||
package org.eclipse.tm.internal.terminal.control.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
@ -40,12 +40,12 @@ import org.eclipse.swt.widgets.Control;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.tm.internal.terminal.control.ITerminalListener;
|
||||
import org.eclipse.tm.internal.terminal.control.ITerminalViewControl;
|
||||
import org.eclipse.tm.terminal.ITerminalConnector;
|
||||
import org.eclipse.tm.terminal.ITerminalControl;
|
||||
import org.eclipse.tm.terminal.Logger;
|
||||
import org.eclipse.tm.terminal.TerminalState;
|
||||
import org.eclipse.tm.terminal.control.ITerminalListener;
|
||||
import org.eclipse.tm.terminal.control.ITerminalViewControl;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.contexts.IContextActivation;
|
||||
import org.eclipse.ui.contexts.IContextService;
|
|
@ -9,7 +9,7 @@
|
|||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.control;
|
||||
package org.eclipse.tm.internal.terminal.control.impl;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.control;
|
||||
package org.eclipse.tm.internal.terminal.control.impl;
|
||||
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.tm.terminal.Logger;
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.control;
|
||||
package org.eclipse.tm.internal.terminal.control.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
@ -31,10 +31,10 @@ import org.eclipse.swt.events.ControlListener;
|
|||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.tm.internal.terminal.telnet.TelnetConnection;
|
||||
import org.eclipse.tm.terminal.ITerminalConnector;
|
||||
import org.eclipse.tm.terminal.Logger;
|
||||
import org.eclipse.tm.terminal.TerminalState;
|
||||
import org.eclipse.tm.terminal.internal.telnet.TelnetConnection;
|
||||
|
||||
/**
|
||||
* This class processes character data received from the remote host and
|
|
@ -9,7 +9,7 @@
|
|||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
import org.eclipse.tm.terminal.ISettingsStore;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalNetworkPortMap
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -12,7 +12,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
/**
|
||||
* This interface defines symbolic constants for numeric TELNET protocol command and
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalControl
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
import java.net.ConnectException;
|
||||
import java.net.InetSocketAddress;
|
|
@ -12,7 +12,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalControl
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
|
@ -9,7 +9,7 @@
|
|||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalProperties
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
public class TelnetProperties {
|
||||
private final NetworkPortMap fNetworkPortMap;
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalSettings
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
import org.eclipse.tm.terminal.ISettingsStore;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - extracted from TerminalSettingsDlg
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.internal.telnet;
|
||||
package org.eclipse.tm.internal.terminal.telnet;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
|
@ -18,7 +18,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
|
|||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.RegistryFactory;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.tm.terminal.internal.control.TerminalPlugin;
|
||||
import org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin;
|
||||
|
||||
/**
|
||||
* A factory to get {@link ITerminalConnector} instances.
|
||||
|
|
Loading…
Add table
Reference in a new issue