mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 12:05:21 +02:00
UNFINISHED (does not work as expected) - bug 205486: [terminal] create a switch for scroll locking
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205486
This commit is contained in:
parent
e48c0ba278
commit
36ae768f63
11 changed files with 151 additions and 60 deletions
|
@ -11,7 +11,7 @@
|
||||||
* Helmut Haigermoser and Ted Williams.
|
* Helmut Haigermoser and Ted Williams.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.actions;
|
package org.eclipse.tm.internal.terminal.actions;
|
||||||
|
@ -27,6 +27,9 @@ public class ActionMessages extends NLS {
|
||||||
public static String TOGGLE_COMMAND_INPUT_FIELD;
|
public static String TOGGLE_COMMAND_INPUT_FIELD;
|
||||||
public static String DISCONNECT;
|
public static String DISCONNECT;
|
||||||
public static String SETTINGS_ELLIPSE;
|
public static String SETTINGS_ELLIPSE;
|
||||||
|
public static String SCROLL_LOCK_0;
|
||||||
|
public static String SCROLL_LOCK_1;
|
||||||
|
|
||||||
public static String COPY;
|
public static String COPY;
|
||||||
public static String CUT;
|
public static String CUT;
|
||||||
public static String PASTE;
|
public static String PASTE;
|
||||||
|
|
|
@ -18,10 +18,12 @@ NEW_TERMINAL = New Terminal
|
||||||
CONNECT = Connect
|
CONNECT = Connect
|
||||||
DISCONNECT = Disconnect
|
DISCONNECT = Disconnect
|
||||||
SETTINGS_ELLIPSE = Settings...
|
SETTINGS_ELLIPSE = Settings...
|
||||||
|
SCROLL_LOCK_0 = Scroll &Lock
|
||||||
|
SCROLL_LOCK_1 = Scroll Lock
|
||||||
COPY = Copy
|
COPY = Copy
|
||||||
CUT = Cut
|
CUT = Cut
|
||||||
PASTE = Paste
|
PASTE = Paste
|
||||||
SELECTALL = Select All
|
SELECTALL = Select All
|
||||||
CLEARALL = Clear All
|
CLEARALL = Clear Terminal
|
||||||
SETTINGS = Settings
|
SETTINGS = Settings
|
||||||
TOGGLE_COMMAND_INPUT_FIELD= Toggle Command Input Field
|
TOGGLE_COMMAND_INPUT_FIELD= Toggle Command Input Field
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
* Helmut Haigermoser and Ted Williams.
|
* Helmut Haigermoser and Ted Williams.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.actions;
|
package org.eclipse.tm.internal.terminal.actions;
|
||||||
|
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
|
||||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||||
|
import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
||||||
|
|
||||||
public class TerminalActionClearAll extends TerminalAction
|
public class TerminalActionClearAll extends TerminalAction
|
||||||
{
|
{
|
||||||
|
@ -28,9 +28,9 @@ public class TerminalActionClearAll extends TerminalAction
|
||||||
|
|
||||||
setupAction(ActionMessages.CLEARALL,
|
setupAction(ActionMessages.CLEARALL,
|
||||||
ActionMessages.CLEARALL,
|
ActionMessages.CLEARALL,
|
||||||
(ImageDescriptor)null,
|
ImageConsts.IMAGE_CLCL_CLEAR_ALL,
|
||||||
null,
|
ImageConsts.IMAGE_ELCL_CLEAR_ALL,
|
||||||
null,
|
ImageConsts.IMAGE_DLCL_CLEAR_ALL,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2004, 2007 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.IAction;
|
||||||
|
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||||
|
import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
||||||
|
|
||||||
|
public class TerminalActionScrollLock extends TerminalAction
|
||||||
|
{
|
||||||
|
public TerminalActionScrollLock(ITerminalView target)
|
||||||
|
{
|
||||||
|
super(target,
|
||||||
|
TerminalActionScrollLock.class.getName(),IAction.AS_RADIO_BUTTON);
|
||||||
|
|
||||||
|
setupAction(ActionMessages.SCROLL_LOCK_0,
|
||||||
|
ActionMessages.SCROLL_LOCK_1,
|
||||||
|
ImageConsts.IMAGE_CLCL_SCROLL_LOCK,
|
||||||
|
ImageConsts.IMAGE_ELCL_SCROLL_LOCK,
|
||||||
|
ImageConsts.IMAGE_DLCL_SCROLL_LOCK,
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
public void run() {
|
||||||
|
fTarget.setScrollLock(!fTarget.isScrollLock());
|
||||||
|
setChecked(fTarget.isScrollLock());
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
* Michael Scharf (Wind River) - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
package org.eclipse.tm.internal.terminal.view;
|
||||||
|
|
||||||
|
@ -28,4 +28,6 @@ public interface ITerminalView {
|
||||||
public void onEditSelectAll();
|
public void onEditSelectAll();
|
||||||
public boolean hasCommandInputField();
|
public boolean hasCommandInputField();
|
||||||
public void setCommandInputField(boolean on);
|
public void setCommandInputField(boolean on);
|
||||||
|
public boolean isScrollLock();
|
||||||
|
public void setScrollLock(boolean b);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
* Helmut Haigermoser and Ted Williams.
|
* Helmut Haigermoser and Ted Williams.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - extracted from TerminalConsts
|
* Michael Scharf (Wind River) - extracted from TerminalConsts
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
package org.eclipse.tm.internal.terminal.view;
|
||||||
|
|
||||||
public interface ImageConsts
|
public interface ImageConsts
|
||||||
{
|
{
|
||||||
public final static String IMAGE_DIR_ROOT = "icons/"; //$NON-NLS-1$
|
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_CTOOL = "ctool16/"; // basic colors - size 16x16 //$NON-NLS-1$
|
||||||
|
@ -33,14 +33,20 @@ public interface ImageConsts
|
||||||
public static final String IMAGE_CLCL_CONNECT = "ImageClclConnect"; //$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_DISCONNECT = "ImageClclDisconnect"; //$NON-NLS-1$
|
||||||
public static final String IMAGE_CLCL_SETTINGS = "ImageClclSettings"; //$NON-NLS-1$
|
public static final String IMAGE_CLCL_SETTINGS = "ImageClclSettings"; //$NON-NLS-1$
|
||||||
|
public static final String IMAGE_CLCL_CLEAR_ALL = "ImageClclClearAll"; //$NON-NLS-1$
|
||||||
|
public static final String IMAGE_CLCL_SCROLL_LOCK = "ImageClclScrollLock"; //$NON-NLS-1$
|
||||||
|
|
||||||
public static final String IMAGE_DLCL_CONNECT = "ImageDlclConnect"; //$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_DISCONNECT = "ImageDlclDisconnect"; //$NON-NLS-1$
|
||||||
public static final String IMAGE_DLCL_SETTINGS = "ImageDlclSettings"; //$NON-NLS-1$
|
public static final String IMAGE_DLCL_SETTINGS = "ImageDlclSettings"; //$NON-NLS-1$
|
||||||
|
public static final String IMAGE_DLCL_CLEAR_ALL = "ImageDlclClearAll"; //$NON-NLS-1$
|
||||||
|
public static final String IMAGE_DLCL_SCROLL_LOCK = "ImageDlclScrollLock"; //$NON-NLS-1$
|
||||||
|
|
||||||
public static final String IMAGE_ELCL_CONNECT = "ImageElclConnect"; //$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_DISCONNECT = "ImageElclDisconnect"; //$NON-NLS-1$
|
||||||
public static final String IMAGE_ELCL_SETTINGS = "ImageElclSettings"; //$NON-NLS-1$
|
public static final String IMAGE_ELCL_SETTINGS = "ImageElclSettings"; //$NON-NLS-1$
|
||||||
|
public static final String IMAGE_ELCL_CLEAR_ALL = "ImageElclClearAll"; //$NON-NLS-1$
|
||||||
|
public static final String IMAGE_ELCL_SCROLL_LOCK = "ImageElclScrollLock"; //$NON-NLS-1$
|
||||||
public static final String IMAGE_CLCL_COMMAND_INPUT_FIELD = "ImageClclCommandInputField";//$NON-NLS-1$
|
public static final String IMAGE_CLCL_COMMAND_INPUT_FIELD = "ImageClclCommandInputField";//$NON-NLS-1$
|
||||||
public static final String IMAGE_ELCL_COMMAND_INPUT_FIELD = "ImageDlclCommandInputField";//$NON-NLS-1$
|
public static final String IMAGE_ELCL_COMMAND_INPUT_FIELD = "ImageDlclCommandInputField";//$NON-NLS-1$
|
||||||
public static final String IMAGE_DLCL_COMMAND_INPUT_FIELD = "ImageDlclCommandInputField";//$NON-NLS-1$
|
public static final String IMAGE_DLCL_COMMAND_INPUT_FIELD = "ImageDlclCommandInputField";//$NON-NLS-1$
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* Helmut Haigermoser and Ted Williams.
|
* Helmut Haigermoser and Ted Williams.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
package org.eclipse.tm.internal.terminal.view;
|
||||||
|
@ -88,6 +88,8 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
|
|
||||||
protected TerminalAction fActionTerminalConnect;
|
protected TerminalAction fActionTerminalConnect;
|
||||||
|
|
||||||
|
// private TerminalAction fActionTerminalScrollLock;
|
||||||
|
|
||||||
protected TerminalAction fActionTerminalDisconnect;
|
protected TerminalAction fActionTerminalDisconnect;
|
||||||
|
|
||||||
protected TerminalAction fActionTerminalSettings;
|
protected TerminalAction fActionTerminalSettings;
|
||||||
|
@ -103,13 +105,13 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
protected TerminalAction fActionEditSelectAll;
|
protected TerminalAction fActionEditSelectAll;
|
||||||
|
|
||||||
protected TerminalAction fActionToggleCommandInputField;
|
protected TerminalAction fActionToggleCommandInputField;
|
||||||
|
|
||||||
protected TerminalMenuHandlerEdit fMenuHandlerEdit;
|
protected TerminalMenuHandlerEdit fMenuHandlerEdit;
|
||||||
|
|
||||||
protected TerminalPropertyChangeHandler fPropertyChangeHandler;
|
protected TerminalPropertyChangeHandler fPropertyChangeHandler;
|
||||||
|
|
||||||
protected boolean fMenuAboutToShow;
|
protected boolean fMenuAboutToShow;
|
||||||
|
|
||||||
private SettingsStore fStore;
|
private SettingsStore fStore;
|
||||||
|
|
||||||
private CommandInputFieldWithHistory fCommandInputField;
|
private CommandInputFieldWithHistory fCommandInputField;
|
||||||
|
@ -125,12 +127,11 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public TerminalView() {
|
public TerminalView() {
|
||||||
Logger
|
Logger
|
||||||
.log("==============================================================="); //$NON-NLS-1$
|
.log("==============================================================="); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
String findUniqueTitle(String title) {
|
String findUniqueTitle(String title) {
|
||||||
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
|
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
|
||||||
String id= getViewSite().getId();
|
String id= getViewSite().getId();
|
||||||
|
@ -166,7 +167,7 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
if(!limitOutput)
|
if(!limitOutput)
|
||||||
bufferLineLimit=-1;
|
bufferLineLimit=-1;
|
||||||
fCtlTerminal.setBufferLineLimit(bufferLineLimit);
|
fCtlTerminal.setBufferLineLimit(bufferLineLimit);
|
||||||
|
|
||||||
}
|
}
|
||||||
// TerminalTarget interface
|
// TerminalTarget interface
|
||||||
public void setState(final TerminalState state) {
|
public void setState(final TerminalState state) {
|
||||||
|
@ -321,7 +322,7 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
setTitleToolTip(getPartName()+": "+strTitle); //$NON-NLS-1$
|
setTitleToolTip(getPartName()+": "+strTitle); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @return the setting summary. If there is no connection, or the connection
|
* @return the setting summary. If there is no connection, or the connection
|
||||||
* has not been initialized, use the last stored state.
|
* has not been initialized, use the last stored state.
|
||||||
*/
|
*/
|
||||||
private String getSettingsSummary() {
|
private String getSettingsSummary() {
|
||||||
|
@ -344,9 +345,9 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
return ViewMessages.STATE_CONNECTED;
|
return ViewMessages.STATE_CONNECTED;
|
||||||
} else if(state==TerminalState.CONNECTING) {
|
} else if(state==TerminalState.CONNECTING) {
|
||||||
return ViewMessages.STATE_CONNECTING;
|
return ViewMessages.STATE_CONNECTING;
|
||||||
} else if(state==TerminalState.OPENED) {
|
} else if(state==TerminalState.OPENED) {
|
||||||
return ViewMessages.STATE_OPENED;
|
return ViewMessages.STATE_OPENED;
|
||||||
} else if(state==TerminalState.CLOSED) {
|
} else if(state==TerminalState.CLOSED) {
|
||||||
return ViewMessages.STATE_CLOSED;
|
return ViewMessages.STATE_CLOSED;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException(state.toString());
|
throw new IllegalStateException(state.toString());
|
||||||
|
@ -472,13 +473,13 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
setCommandInputField("true".equals(fStore.get(STORE_HAS_COMMAND_INPUT_FIELD))); //$NON-NLS-1$
|
setCommandInputField("true".equals(fStore.get(STORE_HAS_COMMAND_INPUT_FIELD))); //$NON-NLS-1$
|
||||||
updatePreferences();
|
updatePreferences();
|
||||||
TerminalViewPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(fPreferenceListener);
|
TerminalViewPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(fPreferenceListener);
|
||||||
|
|
||||||
// restore the title of this view
|
// restore the title of this view
|
||||||
String title=fStore.get(STORE_TITLE);
|
String title=fStore.get(STORE_TITLE);
|
||||||
if(title!=null && title.length()>0)
|
if(title!=null && title.length()>0)
|
||||||
setPartName(title);
|
setPartName(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveSettings(ITerminalConnectorInfo connector) {
|
private void saveSettings(ITerminalConnectorInfo connector) {
|
||||||
ITerminalConnectorInfo[] connectors=fCtlTerminal.getConnectors();
|
ITerminalConnectorInfo[] connectors=fCtlTerminal.getConnectors();
|
||||||
for (int i = 0; i < connectors.length; i++) {
|
for (int i = 0; i < connectors.length; i++) {
|
||||||
|
@ -488,7 +489,7 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
fStore.put(STORE_CONNECTION_TYPE,connector.getId());
|
fStore.put(STORE_CONNECTION_TYPE,connector.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(IViewSite site, IMemento memento) throws PartInitException {
|
public void init(IViewSite site, IMemento memento) throws PartInitException {
|
||||||
super.init(site, memento);
|
super.init(site, memento);
|
||||||
fStore=new SettingsStore(memento);
|
fStore=new SettingsStore(memento);
|
||||||
|
@ -509,6 +510,7 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
|
|
||||||
protected void setupActions() {
|
protected void setupActions() {
|
||||||
fActionTerminalNewTerminal = new TerminalActionNewTerminal(this);
|
fActionTerminalNewTerminal = new TerminalActionNewTerminal(this);
|
||||||
|
// fActionTerminalScrollLock = new TerminalActionScrollLock(this);
|
||||||
fActionTerminalConnect = new TerminalActionConnect(this);
|
fActionTerminalConnect = new TerminalActionConnect(this);
|
||||||
fActionTerminalDisconnect = new TerminalActionDisconnect(this);
|
fActionTerminalDisconnect = new TerminalActionDisconnect(this);
|
||||||
fActionTerminalSettings = new TerminalActionSettings(this);
|
fActionTerminalSettings = new TerminalActionSettings(this);
|
||||||
|
@ -552,6 +554,7 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
IToolBarManager toolBarMgr = getViewSite().getActionBars().getToolBarManager();
|
IToolBarManager toolBarMgr = getViewSite().getActionBars().getToolBarManager();
|
||||||
|
|
||||||
toolBarMgr.add(fActionTerminalNewTerminal);
|
toolBarMgr.add(fActionTerminalNewTerminal);
|
||||||
|
// toolBarMgr.add(fActionTerminalScrollLock);
|
||||||
toolBarMgr.add(fActionTerminalConnect);
|
toolBarMgr.add(fActionTerminalConnect);
|
||||||
toolBarMgr.add(fActionTerminalDisconnect);
|
toolBarMgr.add(fActionTerminalDisconnect);
|
||||||
toolBarMgr.add(fActionTerminalSettings);
|
toolBarMgr.add(fActionTerminalSettings);
|
||||||
|
@ -581,7 +584,10 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
menuMgr.add(new Separator());
|
menuMgr.add(new Separator());
|
||||||
menuMgr.add(fActionEditClearAll);
|
menuMgr.add(fActionEditClearAll);
|
||||||
menuMgr.add(fActionEditSelectAll);
|
menuMgr.add(fActionEditSelectAll);
|
||||||
|
menuMgr.add(new Separator());
|
||||||
menuMgr.add(fActionToggleCommandInputField);
|
menuMgr.add(fActionToggleCommandInputField);
|
||||||
|
// menuMgr.add(fActionTerminalScrollLock);
|
||||||
|
|
||||||
|
|
||||||
// Other plug-ins can contribute there actions here
|
// Other plug-ins can contribute there actions here
|
||||||
menuMgr.add(new Separator("Additions")); //$NON-NLS-1$
|
menuMgr.add(new Separator("Additions")); //$NON-NLS-1$
|
||||||
|
@ -744,4 +750,12 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalLi
|
||||||
}
|
}
|
||||||
fCtlTerminal.setCommandInputField(fCommandInputField);
|
fCtlTerminal.setCommandInputField(fCommandInputField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isScrollLock() {
|
||||||
|
return fCtlTerminal.isScrollLock();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScrollLock(boolean on) {
|
||||||
|
fCtlTerminal.setScrollLock(on);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* Helmut Haigermoser and Ted Williams.
|
* Helmut Haigermoser and Ted Williams.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
package org.eclipse.tm.internal.terminal.view;
|
||||||
|
@ -48,6 +48,8 @@ public class TerminalViewPlugin extends AbstractUIPlugin {
|
||||||
map.put(ImageConsts.IMAGE_CLCL_DISCONNECT, "disconnect_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$
|
map.put(ImageConsts.IMAGE_CLCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$
|
||||||
map.put(ImageConsts.IMAGE_CLCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$
|
map.put(ImageConsts.IMAGE_CLCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$
|
||||||
|
map.put(ImageConsts.IMAGE_CLCL_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$
|
||||||
|
map.put(ImageConsts.IMAGE_CLCL_CLEAR_ALL, "clear_co.gif"); //$NON-NLS-1$
|
||||||
|
|
||||||
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_LOCALTOOL, map);
|
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_LOCALTOOL, map);
|
||||||
|
|
||||||
|
@ -59,6 +61,8 @@ public class TerminalViewPlugin extends AbstractUIPlugin {
|
||||||
map.put(ImageConsts.IMAGE_ELCL_DISCONNECT, "disconnect_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$
|
map.put(ImageConsts.IMAGE_ELCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$
|
||||||
map.put(ImageConsts.IMAGE_ELCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$
|
map.put(ImageConsts.IMAGE_ELCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$
|
||||||
|
map.put(ImageConsts.IMAGE_ELCL_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$
|
||||||
|
map.put(ImageConsts.IMAGE_ELCL_CLEAR_ALL, "clear_co.gif"); //$NON-NLS-1$
|
||||||
|
|
||||||
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_ELCL, map);
|
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_ELCL, map);
|
||||||
|
|
||||||
|
@ -70,6 +74,8 @@ public class TerminalViewPlugin extends AbstractUIPlugin {
|
||||||
map.put(ImageConsts.IMAGE_DLCL_DISCONNECT, "disconnect_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$
|
map.put(ImageConsts.IMAGE_DLCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$
|
||||||
map.put(ImageConsts.IMAGE_DLCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$
|
map.put(ImageConsts.IMAGE_DLCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$
|
||||||
|
map.put(ImageConsts.IMAGE_DLCL_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$
|
||||||
|
map.put(ImageConsts.IMAGE_DLCL_CLEAR_ALL, "clear_co.gif"); //$NON-NLS-1$
|
||||||
|
|
||||||
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_DLCL, map);
|
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_DLCL, map);
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
* Michael Scharf (Wind River) - initial API and implementation
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
@ -50,7 +50,7 @@ public interface ITerminalViewControl {
|
||||||
* @param string write string to terminal
|
* @param string write string to terminal
|
||||||
*/
|
*/
|
||||||
public boolean pasteString(String string);
|
public boolean pasteString(String string);
|
||||||
|
|
||||||
boolean isConnected();
|
boolean isConnected();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +61,7 @@ public interface ITerminalViewControl {
|
||||||
* @return null or the current input field
|
* @return null or the current input field
|
||||||
*/
|
*/
|
||||||
ICommandInputField getCommandInputField();
|
ICommandInputField getCommandInputField();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the maximum number of lines to display
|
* @return the maximum number of lines to display
|
||||||
* in the terminal view. -1 means unlimited.
|
* in the terminal view. -1 means unlimited.
|
||||||
|
@ -70,7 +70,9 @@ public interface ITerminalViewControl {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param bufferLineLimit the maximum number of lines to show
|
* @param bufferLineLimit the maximum number of lines to show
|
||||||
* in the terminal view. -1 means unlimited.
|
* in the terminal view. -1 means unlimited.
|
||||||
*/
|
*/
|
||||||
public void setBufferLineLimit(int bufferLineLimit);
|
public void setBufferLineLimit(int bufferLineLimit);
|
||||||
|
boolean isScrollLock();
|
||||||
|
void setScrollLock(boolean on);
|
||||||
}
|
}
|
|
@ -11,7 +11,7 @@
|
||||||
* Helmut Haigermoser and Ted Williams.
|
* Helmut Haigermoser and Ted Williams.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.control.impl;
|
package org.eclipse.tm.internal.terminal.control.impl;
|
||||||
|
@ -85,7 +85,7 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
|
||||||
private Clipboard fClipboard;
|
private Clipboard fClipboard;
|
||||||
private TerminalModifyListener fModifyListener;
|
private TerminalModifyListener fModifyListener;
|
||||||
private KeyListener fKeyHandler;
|
private KeyListener fKeyHandler;
|
||||||
private ITerminalListener fTerminalListener;
|
private final ITerminalListener fTerminalListener;
|
||||||
private String fMsg = ""; //$NON-NLS-1$
|
private String fMsg = ""; //$NON-NLS-1$
|
||||||
private VerifyKeyListener fVerifyKeyListener;
|
private VerifyKeyListener fVerifyKeyListener;
|
||||||
private FocusListener fFocusListener;
|
private FocusListener fFocusListener;
|
||||||
|
@ -128,7 +128,7 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
|
||||||
// for (int i = 0; i < strText.length(); i++) {
|
// for (int i = 0; i < strText.length(); i++) {
|
||||||
// sendChar(strText.charAt(i), false);
|
// sendChar(strText.charAt(i), false);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
// }.start();
|
// }.start();
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
|
||||||
// TODO
|
// TODO
|
||||||
private void waitForConnect() {
|
private void waitForConnect() {
|
||||||
Logger.log("entered."); //$NON-NLS-1$
|
Logger.log("entered."); //$NON-NLS-1$
|
||||||
// TODO
|
// TODO
|
||||||
// Eliminate this code
|
// Eliminate this code
|
||||||
while (getState()==TerminalState.CONNECTING) {
|
while (getState()==TerminalState.CONNECTING) {
|
||||||
if (fDisplay.readAndDispatch())
|
if (fDisplay.readAndDispatch())
|
||||||
|
@ -288,11 +288,11 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
|
||||||
if (!getMsg().equals("")) //$NON-NLS-1$
|
if (!getMsg().equals("")) //$NON-NLS-1$
|
||||||
{
|
{
|
||||||
showErrorMessage(getMsg());
|
showErrorMessage(getMsg());
|
||||||
|
|
||||||
disconnectTerminal();
|
disconnectTerminal();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getCtlText().setFocus();
|
getCtlText().setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,12 +424,12 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
|
||||||
GridLayout layout=new GridLayout();
|
GridLayout layout=new GridLayout();
|
||||||
layout.marginWidth=0;
|
layout.marginWidth=0;
|
||||||
layout.marginHeight=0;
|
layout.marginHeight=0;
|
||||||
|
|
||||||
fWndParent.setLayout(layout);
|
fWndParent.setLayout(layout);
|
||||||
setCtlText(new StyledText(fWndParent, SWT.V_SCROLL));
|
setCtlText(new StyledText(fWndParent, SWT.V_SCROLL));
|
||||||
fCtlText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
fCtlText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||||
//fCtlText.setWordWrap(false);
|
//fCtlText.setWordWrap(false);
|
||||||
|
|
||||||
fDisplay = getCtlText().getDisplay();
|
fDisplay = getCtlText().getDisplay();
|
||||||
fClipboard = new Clipboard(fDisplay);
|
fClipboard = new Clipboard(fDisplay);
|
||||||
// fViewer.setDocument(new TerminalDocument());
|
// fViewer.setDocument(new TerminalDocument());
|
||||||
|
@ -479,10 +479,10 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// should never happen!
|
// should never happen!
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OutputStream getRemoteToTerminalOutputStream() {
|
public OutputStream getRemoteToTerminalOutputStream() {
|
||||||
return getTerminalText().getOutputStream();
|
return getTerminalText().getOutputStream();
|
||||||
}
|
}
|
||||||
|
@ -835,7 +835,7 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
|
||||||
|
|
||||||
public void setConnector(ITerminalConnectorInfo connector) {
|
public void setConnector(ITerminalConnectorInfo connector) {
|
||||||
fConnectorInfo=connector;
|
fConnectorInfo=connector;
|
||||||
|
|
||||||
}
|
}
|
||||||
public ICommandInputField getCommandInputField() {
|
public ICommandInputField getCommandInputField() {
|
||||||
return fCommandInputField;
|
return fCommandInputField;
|
||||||
|
@ -859,7 +859,14 @@ public class TerminalControl implements ITerminalControlForText, ITerminalContro
|
||||||
public void setBufferLineLimit(int bufferLineLimit) {
|
public void setBufferLineLimit(int bufferLineLimit) {
|
||||||
getTerminalText().setLimitOutput(bufferLineLimit!=-1);
|
getTerminalText().setLimitOutput(bufferLineLimit!=-1);
|
||||||
getTerminalText().setBufferLineLimit(bufferLineLimit);
|
getTerminalText().setBufferLineLimit(bufferLineLimit);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isScrollLock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScrollLock(boolean on) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* Helmut Haigermoser and Ted Williams.
|
* Helmut Haigermoser and Ted Williams.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.emulator;
|
package org.eclipse.tm.internal.terminal.emulator;
|
||||||
|
@ -87,13 +87,13 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
* text processing on data received from the remote host and controls how text is
|
* text processing on data received from the remote host and controls how text is
|
||||||
* displayed using the view's StyledText widget.
|
* displayed using the view's StyledText widget.
|
||||||
*/
|
*/
|
||||||
private VT100Emulator fTerminalText;
|
private final VT100Emulator fTerminalText;
|
||||||
private Display fDisplay;
|
private Display fDisplay;
|
||||||
private TextCanvas fCtlText;
|
private TextCanvas fCtlText;
|
||||||
private Composite fWndParent;
|
private Composite fWndParent;
|
||||||
private Clipboard fClipboard;
|
private Clipboard fClipboard;
|
||||||
private KeyListener fKeyHandler;
|
private KeyListener fKeyHandler;
|
||||||
private ITerminalListener fTerminalListener;
|
private final ITerminalListener fTerminalListener;
|
||||||
private String fMsg = ""; //$NON-NLS-1$
|
private String fMsg = ""; //$NON-NLS-1$
|
||||||
private FocusListener fFocusListener;
|
private FocusListener fFocusListener;
|
||||||
private ITerminalConnectorInfo fConnectorInfo;
|
private ITerminalConnectorInfo fConnectorInfo;
|
||||||
|
@ -104,7 +104,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
|
|
||||||
private volatile TerminalState fState;
|
private volatile TerminalState fState;
|
||||||
|
|
||||||
private ITerminalTextData fTerminalModel;
|
private final ITerminalTextData fTerminalModel;
|
||||||
|
|
||||||
volatile private Job fJob;
|
volatile private Job fJob;
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
fTerminalModel.setMaxHeight(1000);
|
fTerminalModel.setMaxHeight(1000);
|
||||||
fInputStream=new PipedInputStream(8*1024);
|
fInputStream=new PipedInputStream(8*1024);
|
||||||
fTerminalText=new VT100Emulator(fTerminalModel,this,fInputStream);
|
fTerminalText=new VT100Emulator(fTerminalModel,this,fInputStream);
|
||||||
|
|
||||||
setupTerminal(wndParent);
|
setupTerminal(wndParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
// for (int i = 0; i < strText.length(); i++) {
|
// for (int i = 0; i < strText.length(); i++) {
|
||||||
// sendChar(strText.charAt(i), false);
|
// sendChar(strText.charAt(i), false);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
// }.start();
|
// }.start();
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
// TODO
|
// TODO
|
||||||
private void waitForConnect() {
|
private void waitForConnect() {
|
||||||
Logger.log("entered."); //$NON-NLS-1$
|
Logger.log("entered."); //$NON-NLS-1$
|
||||||
// TODO
|
// TODO
|
||||||
// Eliminate this code
|
// Eliminate this code
|
||||||
while (getState()==TerminalState.CONNECTING) {
|
while (getState()==TerminalState.CONNECTING) {
|
||||||
if (fDisplay.readAndDispatch())
|
if (fDisplay.readAndDispatch())
|
||||||
|
@ -303,7 +303,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
if (!getMsg().equals("")) //$NON-NLS-1$
|
if (!getMsg().equals("")) //$NON-NLS-1$
|
||||||
{
|
{
|
||||||
showErrorMessage(getMsg());
|
showErrorMessage(getMsg());
|
||||||
|
|
||||||
disconnectTerminal();
|
disconnectTerminal();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
try {
|
try {
|
||||||
// TODO: should block when no text is available!
|
// TODO: should block when no text is available!
|
||||||
fTerminalText.processText();
|
fTerminalText.processText();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
disconnectTerminal();
|
disconnectTerminal();
|
||||||
status=new Status(IStatus.ERROR,TerminalPlugin.PLUGIN_ID,e.getLocalizedMessage(),e);
|
status=new Status(IStatus.ERROR,TerminalPlugin.PLUGIN_ID,e.getLocalizedMessage(),e);
|
||||||
|
@ -479,9 +479,9 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
GridLayout layout=new GridLayout();
|
GridLayout layout=new GridLayout();
|
||||||
layout.marginWidth=0;
|
layout.marginWidth=0;
|
||||||
layout.marginHeight=0;
|
layout.marginHeight=0;
|
||||||
|
|
||||||
fWndParent.setLayout(layout);
|
fWndParent.setLayout(layout);
|
||||||
|
|
||||||
ITerminalTextDataSnapshot snapshot=fTerminalModel.makeSnapshot();
|
ITerminalTextDataSnapshot snapshot=fTerminalModel.makeSnapshot();
|
||||||
// TODO how to get the initial size correctly!
|
// TODO how to get the initial size correctly!
|
||||||
snapshot.updateSnapshot(false);
|
snapshot.updateSnapshot(false);
|
||||||
|
@ -543,10 +543,10 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// should never happen!
|
// should never happen!
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OutputStream getRemoteToTerminalOutputStream() {
|
public OutputStream getRemoteToTerminalOutputStream() {
|
||||||
return fInputStream.getOutputStream();
|
return fInputStream.getOutputStream();
|
||||||
}
|
}
|
||||||
|
@ -869,7 +869,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
|
|
||||||
public void setConnector(ITerminalConnectorInfo connector) {
|
public void setConnector(ITerminalConnectorInfo connector) {
|
||||||
fConnectorInfo=connector;
|
fConnectorInfo=connector;
|
||||||
|
|
||||||
}
|
}
|
||||||
public ICommandInputField getCommandInputField() {
|
public ICommandInputField getCommandInputField() {
|
||||||
return fCommandInputField;
|
return fCommandInputField;
|
||||||
|
@ -898,4 +898,12 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
fTerminalModel.setMaxHeight(bufferLineLimit);
|
fTerminalModel.setMaxHeight(bufferLineLimit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isScrollLock() {
|
||||||
|
return fCtlText.isScrollLock();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScrollLock(boolean on) {
|
||||||
|
fCtlText.setScrollLock(on);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue