mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 03:55:22 +02:00
[fix] Bug 260372 - [terminal] Certain terminal actions are enabled if no target terminal control is available
This commit is contained in:
parent
728c02223c
commit
995c8f06e7
5 changed files with 18 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2004, 2009 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
|
||||
|
@ -14,6 +14,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
||||
* Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available
|
||||
********************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.control.actions;
|
||||
|
||||
|
@ -47,9 +48,6 @@ public class TerminalActionClearAll extends AbstractTerminalAction {
|
|||
|
||||
public void updateAction(boolean aboutToShow) {
|
||||
ITerminalViewControl target = getTarget();
|
||||
if (target != null)
|
||||
setEnabled(!target.isEmpty());
|
||||
else
|
||||
setEnabled(false);
|
||||
setEnabled(target != null && !target.isEmpty());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2004, 2009 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
|
||||
|
@ -14,6 +14,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
||||
* Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.control.actions;
|
||||
|
||||
|
@ -54,9 +55,9 @@ public class TerminalActionCopy extends AbstractTerminalAction {
|
|||
}
|
||||
|
||||
public void updateAction(boolean aboutToShow) {
|
||||
boolean bEnabled = true;
|
||||
ITerminalViewControl target = getTarget();
|
||||
if (aboutToShow && target != null) {
|
||||
boolean bEnabled = target != null;
|
||||
if (aboutToShow && bEnabled) {
|
||||
bEnabled = target.getSelection().length() > 0;
|
||||
}
|
||||
setEnabled(bEnabled);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2004, 2009 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
|
||||
|
@ -13,6 +13,7 @@
|
|||
* Contributors:
|
||||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
* Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.control.actions;
|
||||
|
||||
|
@ -47,9 +48,7 @@ public class TerminalActionCut extends AbstractTerminalAction {
|
|||
}
|
||||
|
||||
public void updateAction(boolean aboutToShow) {
|
||||
boolean bEnabled;
|
||||
|
||||
bEnabled = !aboutToShow;
|
||||
setEnabled(bEnabled);
|
||||
// Cut is always disabled
|
||||
setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2004, 2009 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
|
||||
|
@ -14,6 +14,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
||||
* Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.control.actions;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class TerminalActionPaste extends AbstractTerminalAction {
|
|||
}
|
||||
|
||||
public void updateAction(boolean aboutToShow) {
|
||||
boolean bEnabled = false;
|
||||
ITerminalViewControl target = getTarget();
|
||||
if (target != null) {
|
||||
boolean bEnabled = target != null;
|
||||
if (bEnabled) {
|
||||
String strText = (String) target.getClipboard().getContents(
|
||||
TextTransfer.getInstance());
|
||||
bEnabled = ((strText != null) && (!strText.equals("")) && (target.getState() == TerminalState.CONNECTED));//$NON-NLS-1$
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2008 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2004, 2009 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
|
||||
|
@ -14,6 +14,7 @@
|
|||
* Michael Scharf (Wind River) - split into core, view and connector plugins
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
|
||||
* Uwe Stieber (Wind River) - [260372] [terminal] Certain terminal actions are enabled if no target terminal control is available
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.control.actions;
|
||||
|
||||
|
@ -44,9 +45,6 @@ public class TerminalActionSelectAll extends AbstractTerminalAction {
|
|||
|
||||
public void updateAction(boolean aboutToShow) {
|
||||
ITerminalViewControl target = getTarget();
|
||||
if (target != null)
|
||||
setEnabled(!target.isEmpty());
|
||||
else
|
||||
setEnabled(false);
|
||||
setEnabled(target != null && !target.isEmpty());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue