mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
overrides
This commit is contained in:
@@ -78,6 +78,7 @@ public class ComboboxEditorTextField extends EditorTextField {
|
||||
UIUtil.setComboBoxEditorBounds(x, y, width, height, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateBorder(@NotNull final EditorEx editor) {
|
||||
if (UIUtil.isUnderAquaLookAndFeel()) {
|
||||
editor.setBorder(isEnabled() ? EDITOR_TEXTFIELD_BORDER : EDITOR_TEXTFIELD_DISABLED_BORDER);
|
||||
|
||||
@@ -49,10 +49,12 @@ public class WatchInplaceEditor extends XDebuggerTreeInplaceEditor {
|
||||
new WatchEditorSessionListener(session).install();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JComponent createInplaceEditorComponent() {
|
||||
return myExpressionEditor.getComponent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelEditing() {
|
||||
if (!isShown()) return;
|
||||
super.cancelEditing();
|
||||
@@ -62,6 +64,7 @@ public class WatchInplaceEditor extends XDebuggerTreeInplaceEditor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doOKAction() {
|
||||
String expression = myExpressionEditor.getText();
|
||||
myExpressionEditor.saveTextInHistory();
|
||||
|
||||
+13
@@ -116,6 +116,7 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
layeredPane.add(inplaceEditorComponent, new Integer(250));
|
||||
|
||||
myRemoveActions.add(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
layeredPane.remove(inplaceEditorComponent);
|
||||
}
|
||||
@@ -126,9 +127,11 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
getPreferredFocusedComponent().requestFocus();
|
||||
|
||||
final ComponentAdapter componentListener = new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
final Project project = getProject();
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!isShown() || project == null || project.isDisposed()) {
|
||||
return;
|
||||
@@ -146,6 +149,7 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentHidden(ComponentEvent e) {
|
||||
cancelEditing();
|
||||
}
|
||||
@@ -165,6 +169,7 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
rootPane.addComponentListener(componentListener);
|
||||
|
||||
myRemoveActions.add(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tree.removeHierarchyListener(hierarchyListener);
|
||||
tree.addComponentListener(componentListener);
|
||||
@@ -174,16 +179,19 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
|
||||
final RunContentManager contentManager = ExecutionManager.getInstance(getProject()).getContentManager();
|
||||
final RunContentListener runContentListener = new RunContentListener() {
|
||||
@Override
|
||||
public void contentSelected(RunContentDescriptor descriptor) {
|
||||
cancelEditing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentRemoved(RunContentDescriptor descriptor) {
|
||||
cancelEditing();
|
||||
}
|
||||
};
|
||||
contentManager.addRunContentListener(runContentListener);
|
||||
myRemoveActions.add(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
contentManager.removeRunContentListener(runContentListener);
|
||||
}
|
||||
@@ -192,18 +200,21 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
final JComponent editorComponent = getEditorComponent();
|
||||
editorComponent.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enterStroke");
|
||||
editorComponent.getActionMap().put("enterStroke", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
doOKAction();
|
||||
}
|
||||
});
|
||||
editorComponent.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "escapeStroke");
|
||||
editorComponent.getActionMap().put("escapeStroke", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
cancelEditing();
|
||||
}
|
||||
});
|
||||
final Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!isShown()) return;
|
||||
defaultToolkit.addAWTEventListener(TreeInplaceEditor.this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_WHEEL_EVENT_MASK);
|
||||
@@ -211,6 +222,7 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
});
|
||||
|
||||
myRemoveActions.add(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
defaultToolkit.removeAWTEventListener(TreeInplaceEditor.this);
|
||||
}
|
||||
@@ -221,6 +233,7 @@ public abstract class TreeInplaceEditor implements AWTEventListener {
|
||||
protected void onShown() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void eventDispatched(AWTEvent event) {
|
||||
if (!isShown()) {
|
||||
return;
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ public class WatchMessageNode extends MessageTreeNode implements WatchNode {
|
||||
setIcon(icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getExpression() {
|
||||
return myExpression;
|
||||
|
||||
+1
-2
@@ -187,8 +187,7 @@ public class WatchesRootNode extends XDebuggerTreeNode {
|
||||
myChildren.set(index, messageNode);
|
||||
fireNodeStructureChanged(messageNode);
|
||||
}
|
||||
WatchInplaceEditor editor = new WatchInplaceEditor(this, mySession, myWatchesView, messageNode, "watch", node);
|
||||
editor.show();
|
||||
new WatchInplaceEditor(this, mySession, myWatchesView, messageNode, "watch", node).show();
|
||||
}
|
||||
|
||||
private class MyEvaluationCallback extends XEvaluationCallbackBase {
|
||||
|
||||
Reference in New Issue
Block a user