mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 12:05:21 +02:00
bug 240023: [terminal] Get rid of the terminal's "Pin" button
https://bugs.eclipse.org/bugs/show_bug.cgi?id=240023
This commit is contained in:
parent
5a485ef094
commit
77a4acc0cf
11 changed files with 91 additions and 110 deletions
Binary file not shown.
Before Width: | Height: | Size: 358 B |
Binary file not shown.
Before Width: | Height: | Size: 223 B |
Binary file not shown.
Before Width: | Height: | Size: 358 B |
|
@ -14,6 +14,7 @@
|
||||||
* 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
|
||||||
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
||||||
|
* Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.actions;
|
package org.eclipse.tm.internal.terminal.actions;
|
||||||
|
|
||||||
|
@ -24,7 +25,8 @@ public class ActionMessages extends NLS {
|
||||||
static {
|
static {
|
||||||
NLS.initializeMessages(ActionMessages.class.getName(), ActionMessages.class);
|
NLS.initializeMessages(ActionMessages.class.getName(), ActionMessages.class);
|
||||||
}
|
}
|
||||||
public static String NEW_TERMINAL;
|
public static String NEW_TERMINAL_CONNECTION;
|
||||||
|
public static String NEW_TERMINAL_VIEW;
|
||||||
public static String CONNECT;
|
public static String CONNECT;
|
||||||
public static String TOGGLE_COMMAND_INPUT_FIELD;
|
public static String TOGGLE_COMMAND_INPUT_FIELD;
|
||||||
public static String DISCONNECT;
|
public static String DISCONNECT;
|
||||||
|
@ -32,7 +34,6 @@ public class ActionMessages extends NLS {
|
||||||
public static String SCROLL_LOCK_0;
|
public static String SCROLL_LOCK_0;
|
||||||
public static String SCROLL_LOCK_1;
|
public static String SCROLL_LOCK_1;
|
||||||
public static String REMOVE;
|
public static String REMOVE;
|
||||||
public static String PIN;
|
|
||||||
|
|
||||||
public static String ConsoleDropDownAction_0;
|
public static String ConsoleDropDownAction_0;
|
||||||
public static String ConsoleDropDownAction_1;
|
public static String ConsoleDropDownAction_1;
|
||||||
|
|
|
@ -15,8 +15,10 @@
|
||||||
# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
# Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
# Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
# Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
||||||
# Michael Scharf (Wind River) - [172483] switch between connections
|
# Michael Scharf (Wind River) - [172483] switch between connections
|
||||||
|
# Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button
|
||||||
###############################################################################
|
###############################################################################
|
||||||
NEW_TERMINAL = New Terminal
|
NEW_TERMINAL_CONNECTION = New Terminal Connection...
|
||||||
|
NEW_TERMINAL_VIEW = New Terminal View
|
||||||
CONNECT = Connect
|
CONNECT = Connect
|
||||||
DISCONNECT = Disconnect
|
DISCONNECT = Disconnect
|
||||||
SETTINGS_ELLIPSE = Settings...
|
SETTINGS_ELLIPSE = Settings...
|
||||||
|
@ -25,7 +27,6 @@ SCROLL_LOCK_1 = Scroll Lock
|
||||||
SETTINGS = Settings
|
SETTINGS = Settings
|
||||||
TOGGLE_COMMAND_INPUT_FIELD= Toggle Command Input Field
|
TOGGLE_COMMAND_INPUT_FIELD= Toggle Command Input Field
|
||||||
REMOVE = Remove Terminal
|
REMOVE = Remove Terminal
|
||||||
PIN = Pin Terminal
|
|
||||||
|
|
||||||
ConsoleDropDownAction_0=Select Connection
|
ConsoleDropDownAction_0=Select Connection
|
||||||
ConsoleDropDownAction_1=Display Selected Connections
|
ConsoleDropDownAction_1=Display Selected Connections
|
||||||
|
|
|
@ -13,9 +13,16 @@
|
||||||
* 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
|
||||||
*******************************************************************************/
|
* Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button
|
||||||
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.actions;
|
package org.eclipse.tm.internal.terminal.actions;
|
||||||
|
|
||||||
|
import org.eclipse.jface.action.Action;
|
||||||
|
import org.eclipse.jface.action.ActionContributionItem;
|
||||||
|
import org.eclipse.jface.action.IAction;
|
||||||
|
import org.eclipse.jface.action.IMenuCreator;
|
||||||
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
import org.eclipse.tm.internal.terminal.view.ITerminalView;
|
||||||
import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
||||||
|
|
||||||
|
@ -24,23 +31,53 @@ import org.eclipse.tm.internal.terminal.view.ImageConsts;
|
||||||
*
|
*
|
||||||
* @author Fran Litterio <francis.litterio@windriver.com>
|
* @author Fran Litterio <francis.litterio@windriver.com>
|
||||||
*/
|
*/
|
||||||
public class TerminalActionNewTerminal extends TerminalAction
|
public class TerminalActionNewTerminal extends TerminalAction implements IMenuCreator {
|
||||||
{
|
private Menu fMenu;
|
||||||
/**
|
|
||||||
* UNDER CONSTRUCTION
|
|
||||||
*/
|
|
||||||
public TerminalActionNewTerminal(ITerminalView target)
|
public TerminalActionNewTerminal(ITerminalView target)
|
||||||
{
|
{
|
||||||
super(target, TerminalActionNewTerminal.class.getName());
|
super(target, TerminalActionNewTerminal.class.getName());
|
||||||
|
|
||||||
setupAction(ActionMessages.NEW_TERMINAL,
|
setupAction(ActionMessages.NEW_TERMINAL_CONNECTION,
|
||||||
ActionMessages.NEW_TERMINAL,
|
ActionMessages.NEW_TERMINAL_CONNECTION,
|
||||||
ImageConsts.IMAGE_NEW_TERMINAL,
|
ImageConsts.IMAGE_NEW_TERMINAL,
|
||||||
ImageConsts.IMAGE_NEW_TERMINAL,
|
ImageConsts.IMAGE_NEW_TERMINAL,
|
||||||
ImageConsts.IMAGE_NEW_TERMINAL,
|
ImageConsts.IMAGE_NEW_TERMINAL,
|
||||||
true);
|
true);
|
||||||
|
setMenuCreator(this);
|
||||||
}
|
}
|
||||||
public void run() {
|
public void run() {
|
||||||
fTarget.onTerminalNewTerminal();
|
fTarget.onTerminalNewTerminal();
|
||||||
}
|
}
|
||||||
|
public void dispose() {
|
||||||
|
if (fMenu != null) {
|
||||||
|
fMenu.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Menu getMenu(Control parent) {
|
||||||
|
if(fMenu==null) {
|
||||||
|
fMenu= new Menu(parent);
|
||||||
|
addActionToMenu(fMenu,
|
||||||
|
new Action(ActionMessages.NEW_TERMINAL_CONNECTION) {
|
||||||
|
public void run() {
|
||||||
|
fTarget.onTerminalNewTerminal();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
addActionToMenu(fMenu,
|
||||||
|
new Action(ActionMessages.NEW_TERMINAL_VIEW) {
|
||||||
|
public void run() {
|
||||||
|
fTarget.onTerminalNewView();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return fMenu;
|
||||||
|
}
|
||||||
|
protected void addActionToMenu(Menu parent, IAction action) {
|
||||||
|
ActionContributionItem item = new ActionContributionItem(action);
|
||||||
|
item.fill(parent, -1);
|
||||||
|
}
|
||||||
|
public Menu getMenu(Menu parent) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2008 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.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 TerminalActionPin extends TerminalAction
|
|
||||||
{
|
|
||||||
public TerminalActionPin(ITerminalView target)
|
|
||||||
{
|
|
||||||
super(target,
|
|
||||||
TerminalActionPin.class.getName(),IAction.AS_RADIO_BUTTON);
|
|
||||||
|
|
||||||
setupAction(ActionMessages.PIN,
|
|
||||||
ActionMessages.PIN,
|
|
||||||
ImageConsts.IMAGE_CLCL_PIN,
|
|
||||||
ImageConsts.IMAGE_ELCL_PIN,
|
|
||||||
ImageConsts.IMAGE_DLCL_PIN,
|
|
||||||
true);
|
|
||||||
setChecked(fTarget.isPinned());
|
|
||||||
}
|
|
||||||
public void run() {
|
|
||||||
fTarget.setPinned(!fTarget.isPinned());
|
|
||||||
setChecked(fTarget.isPinned());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -9,24 +9,26 @@
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
* Michael Scharf (Wind River) - initial API and implementation
|
||||||
* Martin Oberhuber (Wind River) - [227537] moved actions from terminal.view to terminal plugin
|
* Martin Oberhuber (Wind River) - [227537] moved actions from terminal.view to terminal plugin
|
||||||
* Michael Scharf (Wind River) - [172483] switch between connections
|
* Michael Scharf (Wind River) - [172483] switch between connections
|
||||||
|
* Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
package org.eclipse.tm.internal.terminal.view;
|
||||||
|
|
||||||
public interface ITerminalView {
|
public interface ITerminalView {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a new Terminal view. This method is called when the user clicks the New
|
* Create a new terminal connection within the view.
|
||||||
* Terminal button in any Terminal view's toolbar.
|
|
||||||
*/
|
*/
|
||||||
public void onTerminalNewTerminal();
|
void onTerminalNewTerminal();
|
||||||
public void onTerminalConnect();
|
/**
|
||||||
public void onTerminalDisconnect();
|
* Create a new Terminal view.
|
||||||
public void onTerminalSettings();
|
*/
|
||||||
public void onTerminalFontChanged();
|
void onTerminalNewView();
|
||||||
public boolean hasCommandInputField();
|
void onTerminalConnect();
|
||||||
public void setCommandInputField(boolean on);
|
void onTerminalDisconnect();
|
||||||
public boolean isScrollLock();
|
void onTerminalSettings();
|
||||||
public void setScrollLock(boolean b);
|
void onTerminalFontChanged();
|
||||||
public void setPinned(boolean pin);
|
boolean hasCommandInputField();
|
||||||
public boolean isPinned();
|
void setCommandInputField(boolean on);
|
||||||
|
boolean isScrollLock();
|
||||||
|
void setScrollLock(boolean b);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
||||||
* Michael Scharf (Wind River) - [172483] added some more icons
|
* Michael Scharf (Wind River) - [172483] added some more icons
|
||||||
|
* Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
package org.eclipse.tm.internal.terminal.view;
|
||||||
|
|
||||||
|
@ -33,20 +34,17 @@ public interface ImageConsts
|
||||||
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_SCROLL_LOCK = "ImageClclScrollLock"; //$NON-NLS-1$
|
public static final String IMAGE_CLCL_SCROLL_LOCK = "ImageClclScrollLock"; //$NON-NLS-1$
|
||||||
public static final String IMAGE_CLCL_PIN = "ImageClclPin"; //$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_SCROLL_LOCK = "ImageDlclScrollLock"; //$NON-NLS-1$
|
public static final String IMAGE_DLCL_SCROLL_LOCK = "ImageDlclScrollLock"; //$NON-NLS-1$
|
||||||
public static final String IMAGE_DLCL_PIN = "ImageDlclPin"; //$NON-NLS-1$
|
|
||||||
public static final String IMAGE_DLCL_REMOVE = "ImageDlclRemove"; //$NON-NLS-1$
|
public static final String IMAGE_DLCL_REMOVE = "ImageDlclRemove"; //$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_SCROLL_LOCK = "ImageElclScrollLock"; //$NON-NLS-1$
|
public static final String IMAGE_ELCL_SCROLL_LOCK = "ImageElclScrollLock"; //$NON-NLS-1$
|
||||||
public static final String IMAGE_ELCL_PIN = "ImageElclPin"; //$NON-NLS-1$
|
|
||||||
public static final String IMAGE_ELCL_REMOVE = "ImageElclRemove"; //$NON-NLS-1$
|
public static final String IMAGE_ELCL_REMOVE = "ImageElclRemove"; //$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$
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
||||||
* Martin Oberhuber (Wind River) - [168186] Add Terminal User Docs
|
* Martin Oberhuber (Wind River) - [168186] Add Terminal User Docs
|
||||||
* Michael Scharf (Wind River) - [172483] switch between connections
|
* Michael Scharf (Wind River) - [172483] switch between connections
|
||||||
|
* Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
package org.eclipse.tm.internal.terminal.view;
|
||||||
|
|
||||||
|
@ -49,7 +50,6 @@ import org.eclipse.tm.internal.terminal.actions.TerminalAction;
|
||||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionConnect;
|
import org.eclipse.tm.internal.terminal.actions.TerminalActionConnect;
|
||||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionDisconnect;
|
import org.eclipse.tm.internal.terminal.actions.TerminalActionDisconnect;
|
||||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionNewTerminal;
|
import org.eclipse.tm.internal.terminal.actions.TerminalActionNewTerminal;
|
||||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionPin;
|
|
||||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionRemove;
|
import org.eclipse.tm.internal.terminal.actions.TerminalActionRemove;
|
||||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionSelectionDropDown;
|
import org.eclipse.tm.internal.terminal.actions.TerminalActionSelectionDropDown;
|
||||||
import org.eclipse.tm.internal.terminal.actions.TerminalActionSettings;
|
import org.eclipse.tm.internal.terminal.actions.TerminalActionSettings;
|
||||||
|
@ -82,8 +82,6 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
|
|
||||||
private static final String STORE_SETTING_SUMMARY = "SettingSummary"; //$NON-NLS-1$
|
private static final String STORE_SETTING_SUMMARY = "SettingSummary"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String STORE_PINNED = "Pinned"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
private static final String STORE_TITLE = "Title"; //$NON-NLS-1$
|
private static final String STORE_TITLE = "Title"; //$NON-NLS-1$
|
||||||
|
|
||||||
public static final String FONT_DEFINITION = "terminal.views.view.font.definition"; //$NON-NLS-1$
|
public static final String FONT_DEFINITION = "terminal.views.view.font.definition"; //$NON-NLS-1$
|
||||||
|
@ -119,7 +117,6 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
protected TerminalPropertyChangeHandler fPropertyChangeHandler;
|
protected TerminalPropertyChangeHandler fPropertyChangeHandler;
|
||||||
|
|
||||||
protected Action fActionTerminalDropDown;
|
protected Action fActionTerminalDropDown;
|
||||||
protected Action fActionTerminalPin;
|
|
||||||
protected Action fActionTerminalRemove;
|
protected Action fActionTerminalRemove;
|
||||||
|
|
||||||
protected boolean fMenuAboutToShow;
|
protected boolean fMenuAboutToShow;
|
||||||
|
@ -142,8 +139,6 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
|
|
||||||
private PageBook fPageBook;
|
private PageBook fPageBook;
|
||||||
|
|
||||||
private boolean fPinned=true;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This listener updates both, the view and the
|
* This listener updates both, the view and the
|
||||||
* ITerminalViewConnection.
|
* ITerminalViewConnection.
|
||||||
|
@ -247,29 +242,29 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
*/
|
*/
|
||||||
public void onTerminalNewTerminal() {
|
public void onTerminalNewTerminal() {
|
||||||
Logger.log("creating new Terminal instance."); //$NON-NLS-1$
|
Logger.log("creating new Terminal instance."); //$NON-NLS-1$
|
||||||
if(isPinned()) {
|
setupControls();
|
||||||
try {
|
if(newConnection()==null) {
|
||||||
// The second argument to showView() is a unique String identifying the
|
fMultiConnectionManager.removeActive();
|
||||||
// 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 undesirable. Therefore, we append the active 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(
|
public void onTerminalNewView() {
|
||||||
"org.eclipse.tm.terminal.view.TerminalView",//$NON-NLS-1$
|
try {
|
||||||
"SecondaryTerminal" + System.currentTimeMillis(), //$NON-NLS-1$
|
// The second argument to showView() is a unique String identifying the
|
||||||
IWorkbenchPage.VIEW_ACTIVATE);
|
// secondary view instance. If it ever matches a previously used secondary
|
||||||
} catch (PartInitException ex) {
|
// view identifier, then this call will not create a new Terminal view,
|
||||||
Logger.logException(ex);
|
// which is undesirable. Therefore, we append the active time in
|
||||||
}
|
// milliseconds to the secondary view identifier to ensure it is always
|
||||||
} else {
|
// unique. This code runs only when the user clicks the New Terminal
|
||||||
setupControls();
|
// button, so there is no risk that this code will run twice in a single
|
||||||
if(newConnection()==null) {
|
// millisecond.
|
||||||
fMultiConnectionManager.removeActive();
|
|
||||||
}
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,13 +490,9 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
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);
|
||||||
// have we stored the pinned status?
|
|
||||||
if(fStore.get(STORE_PINNED)!=null)
|
|
||||||
setPinned("true".equals(fStore.get(STORE_PINNED))); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
public void saveState(IMemento memento) {
|
public void saveState(IMemento memento) {
|
||||||
super.saveState(memento);
|
super.saveState(memento);
|
||||||
fStore.put(STORE_PINNED, isPinned()?"true":"false"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
||||||
fStore.put(STORE_TITLE,getPartName());
|
fStore.put(STORE_TITLE,getPartName());
|
||||||
fMultiConnectionManager.saveState(new SettingStorePrefixDecorator(fStore,"connectionManager")); //$NON-NLS-1$
|
fMultiConnectionManager.saveState(new SettingStorePrefixDecorator(fStore,"connectionManager")); //$NON-NLS-1$
|
||||||
fStore.saveState(memento);
|
fStore.saveState(memento);
|
||||||
|
@ -512,8 +503,6 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
|
|
||||||
protected void setupActions() {
|
protected void setupActions() {
|
||||||
fActionTerminalDropDown = new TerminalActionSelectionDropDown(fMultiConnectionManager);
|
fActionTerminalDropDown = new TerminalActionSelectionDropDown(fMultiConnectionManager);
|
||||||
fActionTerminalPin=new TerminalActionPin(this);
|
|
||||||
fActionTerminalPin.setChecked(isPinned());
|
|
||||||
fActionTerminalRemove=new TerminalActionRemove(fMultiConnectionManager);
|
fActionTerminalRemove=new TerminalActionRemove(fMultiConnectionManager);
|
||||||
fActionTerminalNewTerminal = new TerminalActionNewTerminal(this);
|
fActionTerminalNewTerminal = new TerminalActionNewTerminal(this);
|
||||||
// fActionTerminalScrollLock = new TerminalActionScrollLock(this);
|
// fActionTerminalScrollLock = new TerminalActionScrollLock(this);
|
||||||
|
@ -536,7 +525,6 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
toolBarMgr.add(fActionTerminalSettings);
|
toolBarMgr.add(fActionTerminalSettings);
|
||||||
toolBarMgr.add(fActionToggleCommandInputField);
|
toolBarMgr.add(fActionToggleCommandInputField);
|
||||||
toolBarMgr.add(new Separator("fixedGroup")); //$NON-NLS-1$
|
toolBarMgr.add(new Separator("fixedGroup")); //$NON-NLS-1$
|
||||||
toolBarMgr.add(fActionTerminalPin);
|
|
||||||
toolBarMgr.add(fActionTerminalDropDown);
|
toolBarMgr.add(fActionTerminalDropDown);
|
||||||
toolBarMgr.add(fActionTerminalNewTerminal);
|
toolBarMgr.add(fActionTerminalNewTerminal);
|
||||||
toolBarMgr.add(fActionTerminalRemove);
|
toolBarMgr.add(fActionTerminalRemove);
|
||||||
|
@ -649,14 +637,6 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
|
||||||
updateStatus();
|
updateStatus();
|
||||||
setPartName(getActiveConnection().getPartName());
|
setPartName(getActiveConnection().getPartName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPinned(boolean pinned) {
|
|
||||||
fPinned=pinned;
|
|
||||||
}
|
|
||||||
public boolean isPinned() {
|
|
||||||
return fPinned;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO REMOVE This code (added 2008-06-11)
|
* TODO REMOVE This code (added 2008-06-11)
|
||||||
* Legacy code to real the old state. Once the state of the
|
* Legacy code to real the old state. Once the state of the
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
||||||
* Martin Oberhuber (Wind River) - [168186] Add Terminal User Docs
|
* Martin Oberhuber (Wind River) - [168186] Add Terminal User Docs
|
||||||
* Michael Scharf (Wind River) - [172483] switch between connections
|
* Michael Scharf (Wind River) - [172483] switch between connections
|
||||||
|
* Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.view;
|
package org.eclipse.tm.internal.terminal.view;
|
||||||
|
|
||||||
|
@ -54,7 +55,6 @@ public class TerminalViewPlugin extends AbstractUIPlugin {
|
||||||
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_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$
|
||||||
map.put(ImageConsts.IMAGE_CLCL_PIN, "pin.gif"); //$NON-NLS-1$
|
|
||||||
|
|
||||||
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_LOCALTOOL, map);
|
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_LOCALTOOL, map);
|
||||||
|
|
||||||
|
@ -67,7 +67,6 @@ public class TerminalViewPlugin extends AbstractUIPlugin {
|
||||||
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_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$
|
||||||
map.put(ImageConsts.IMAGE_ELCL_PIN, "pin.gif"); //$NON-NLS-1$
|
|
||||||
map.put(ImageConsts.IMAGE_ELCL_REMOVE, "rem_co.gif"); //$NON-NLS-1$
|
map.put(ImageConsts.IMAGE_ELCL_REMOVE, "rem_co.gif"); //$NON-NLS-1$
|
||||||
|
|
||||||
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_ELCL, map);
|
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_ELCL, map);
|
||||||
|
@ -81,7 +80,6 @@ public class TerminalViewPlugin extends AbstractUIPlugin {
|
||||||
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_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$
|
||||||
map.put(ImageConsts.IMAGE_DLCL_PIN, "pin.gif"); //$NON-NLS-1$
|
|
||||||
map.put(ImageConsts.IMAGE_DLCL_REMOVE, "rem_co.gif"); //$NON-NLS-1$
|
map.put(ImageConsts.IMAGE_DLCL_REMOVE, "rem_co.gif"); //$NON-NLS-1$
|
||||||
|
|
||||||
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_DLCL, map);
|
loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_DLCL, map);
|
||||||
|
|
Loading…
Add table
Reference in a new issue