mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Fix warnings in o.e.tm.terminal.control bundle
Change-Id: Ief69751ba4affc13240cfdb4b79e190b3356bbd9
This commit is contained in:
parent
4a4c5fca4d
commit
adb7247d5c
7 changed files with 20 additions and 12 deletions
|
@ -42,3 +42,5 @@ terminal.command.quickaccess.name=Quick Access
|
|||
terminal.preferences.name = Terminal
|
||||
terminal.font.description = The font for the terminal console.
|
||||
terminal.font.label = Terminal Console Font
|
||||
|
||||
terminal.connectors.name = Terminal Connector Extensions
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
# Martin Oberhuber (Wind River) - [434939] Fix Keybinding conflicts with JEE Luna package
|
||||
-->
|
||||
<plugin>
|
||||
<extension-point id="connectors" name="Terminal Connector Extensions" schema="schema/connectors.exsd"/>
|
||||
<extension-point id="connectors" name="%terminal.connectors.name" schema="schema/connectors.exsd"/>
|
||||
|
||||
<extension point="org.eclipse.ui.contexts">
|
||||
<context
|
||||
|
|
|
@ -60,10 +60,10 @@ public class TerminalActionCopy extends AbstractTerminalAction {
|
|||
@Override
|
||||
public void updateAction(boolean aboutToShow) {
|
||||
ITerminalViewControl target = getTarget();
|
||||
boolean bEnabled = target != null;
|
||||
if (aboutToShow && bEnabled) {
|
||||
bEnabled = target.getSelection().length() > 0;
|
||||
if (aboutToShow && target != null) {
|
||||
setEnabled(!target.getSelection().isEmpty());
|
||||
} else {
|
||||
setEnabled(false);
|
||||
}
|
||||
setEnabled(bEnabled);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,10 +58,16 @@ public class TerminalActionPaste extends AbstractTerminalAction {
|
|||
@Override
|
||||
public void updateAction(boolean aboutToShow) {
|
||||
ITerminalViewControl target = getTarget();
|
||||
boolean bEnabled = target != null && target.getClipboard() != null && !target.getClipboard().isDisposed();
|
||||
if (bEnabled) {
|
||||
String strText = (String) target.getClipboard().getContents(TextTransfer.getInstance());
|
||||
bEnabled = ((strText != null) && (!strText.equals("")) && (target.getState() == TerminalState.CONNECTED));//$NON-NLS-1$
|
||||
boolean bEnabled = false;
|
||||
if (target != null) {
|
||||
if (target.getState() == TerminalState.CONNECTED) {
|
||||
if (target.getClipboard() != null && !target.getClipboard().isDisposed()) {
|
||||
String strText = (String) target.getClipboard().getContents(TextTransfer.getInstance());
|
||||
if (strText != null && !strText.isEmpty()) {
|
||||
bEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
setEnabled(bEnabled);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ class EditActionAccelerators {
|
|||
private static final String COPY_COMMAND_ID = "org.eclipse.tm.terminal.copy"; //$NON-NLS-1$
|
||||
private static final String PASTE_COMMAND_ID = "org.eclipse.tm.terminal.paste"; //$NON-NLS-1$
|
||||
|
||||
private final Map commandIdsByAccelerator = new HashMap();
|
||||
private final Map<Integer, String> commandIdsByAccelerator = new HashMap<Integer, String>();
|
||||
|
||||
private void load() {
|
||||
addAccelerator(COPY_COMMAND_ID);
|
||||
|
|
|
@ -31,7 +31,7 @@ public abstract class AbstractSettingsPage implements ISettingsPage, IMessagePro
|
|||
private int messageType = IMessageProvider.NONE;
|
||||
|
||||
// Reference to the listener
|
||||
private final ListenerList listeners = new ListenerList();
|
||||
private final ListenerList<Listener> listeners = new ListenerList<>();
|
||||
|
||||
// Flag to control the control decorations
|
||||
private boolean hasDecoration = false;
|
||||
|
|
|
@ -49,7 +49,7 @@ public class TerminalConnectorExtension {
|
|||
}
|
||||
String hidden = config.getAttribute("hidden"); //$NON-NLS-1$
|
||||
boolean isHidden = hidden != null ? Boolean.parseBoolean(hidden) : false;
|
||||
TerminalConnector.Factory factory = () -> (TerminalConnectorImpl) config.createExecutableExtension("class");
|
||||
TerminalConnector.Factory factory = () -> (TerminalConnectorImpl) config.createExecutableExtension("class"); //$NON-NLS-1$
|
||||
return new TerminalConnector(factory, id, name, isHidden);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue