use of org.openide.cookies.EditorCookie in project enclojure by EricThorsen.
the class ClojureToolTipAnnotation method getShortDescription.
public String getShortDescription() {
LOG.log(Level.FINEST, "ClojureTooltip: getShortDescription");
toolTipText = null;
DebuggerEngine currentEngine = DebuggerManager.getDebuggerManager().getCurrentEngine();
if (currentEngine == null)
return null;
JPDADebugger d = (JPDADebugger) currentEngine.lookupFirst(null, JPDADebugger.class);
if (d == null)
return null;
Line.Part lp = (Line.Part) getAttachedAnnotatable();
if (lp != null) {
Line line = lp.getLine();
DataObject dob = DataEditorSupport.findDataObject(line);
EditorCookie ec = (EditorCookie) dob.getCookie(EditorCookie.class);
if (ec != null) {
// Only for editable dataobjects
try {
doc = ec.openDocument();
RequestProcessor.getDefault().post(this);
} catch (IOException e) {
}
}
}
return toolTipText;
}
use of org.openide.cookies.EditorCookie in project enclojure by EricThorsen.
the class GotoDeclaration method performAction.
protected void performAction(Node[] activatedNodes) {
try {
EditorCookie editCookie = activatedNodes[0].getLookup().lookup(EditorCookie.class);
gotoDeclarationFn.invoke();
} catch (Exception ex) {
Exceptions.printStackTrace(ex);
}
}
use of org.openide.cookies.EditorCookie in project enclojure by EricThorsen.
the class ToggleComment method performAction.
protected void performAction(Node[] activatedNodes) {
try {
EditorCookie editCookie = activatedNodes[0].getLookup().lookup(EditorCookie.class);
toggleCommentFn.invoke(editCookie);
} catch (Exception ex) {
Exceptions.printStackTrace(ex);
}
}
use of org.openide.cookies.EditorCookie in project Universal-G-Code-Sender by winder.
the class EditGcodeFile method getCurrentlyOpenedEditors.
/**
* Get all the windows in the "Editor" mode, then filter to just editors.
*/
private Collection<TopComponent> getCurrentlyOpenedEditors() {
final ArrayList<TopComponent> result = new ArrayList<>();
Collection<TopComponent> comps = TopComponent.getRegistry().getOpened();
for (TopComponent tc : comps) {
Node[] arr = tc.getActivatedNodes();
for (int j = 0; arr != null && j < arr.length; j++) {
EditorCookie ec = arr[j].getCookie(EditorCookie.class);
if (ec != null) {
result.add(tc);
}
}
}
return result;
}
Aggregations