private void addImports(final StyledDocument styledDocument ) { try { JavaSource.forDocument(styledDocument).runModificationTask(new CancellableTask<WorkingCopy>() { public void cancel() { } public void run(WorkingCopy parameter) throws Exception { parameter.toPhase(JavaSource.Phase.PARSED); for (String fqn : fqns) { SourceUtils.resolveImport(parameter, new TreePath(parameter.getCompilationUnit()), fqn); } } }).commit(); } catch (IOException e) { Exceptions.printStackTrace(e); } } };
final PositionStrategy strategy) JavaSource javaSource = JavaSource.forDocument(component.getDocument()); if ( javaSource == null ){ Toolkit.getDefaultToolkit().beep();
final PositionStrategy strategy ) JavaSource javaSource = JavaSource.forDocument(component.getDocument()); if ( javaSource == null ){ Toolkit.getDefaultToolkit().beep();
JavaSource javaSource = JavaSource.forDocument(component.getDocument()); if ( javaSource == null ){ Toolkit.getDefaultToolkit().beep();
private void addImports(final StyledDocument styledDocument) { try { JavaSource.forDocument(styledDocument).runModificationTask(new CancellableTask<WorkingCopy>() { public void cancel() { } public void run(WorkingCopy parameter) throws Exception { parameter.toPhase(JavaSource.Phase.PARSED); String typeFqn = getComponent().getType().getString(); if (!fullyNamesList.contains(typeFqn)) { fullyNamesList.add(typeFqn); } DesignComponent connector = MidpDatabindingSupport.getConnector(getComponent(), bindedProperty); for (String fqn : fullyNamesList) { if (bindedProperty == null) { SourceUtils.resolveImport(parameter, new TreePath(parameter.getCompilationUnit()), fqn); } else if (connector != null) { SourceUtils.resolveImport(parameter, new TreePath(parameter.getCompilationUnit()), fqn); } } } }).commit(); } catch (IOException e) { Exceptions.printStackTrace(e); } } }
final Object[] context ) JavaSource javaSource = JavaSource.forDocument(component.getDocument()); if ( javaSource == null ){ Toolkit.getDefaultToolkit().beep();
protected void performGlobalGeneration (StyledDocument styledDocument) { JavaSource source = JavaSource.forDocument (styledDocument); try { ModificationResult result = source.runModificationTask (new CancellableTask<WorkingCopy>() {
static SingleMethod getTestMethod(Document doc, int cursor){ SingleMethod sm = null; if (doc != null){ JavaSource js = JavaSource.forDocument(doc); GroovyTestClassInfoTask task = new GroovyTestClassInfoTask(cursor); try { if (js != null) { Future<Void> f = js.runWhenScanFinished(task, true); if (f.isDone() && task.getFileObject() != null && task.getMethodName() != null){ sm = new SingleMethod(task.getFileObject(), task.getMethodName()); } } } catch (IOException ex) { LOGGER.log(Level.WARNING, null, ex); } } return sm; }
public static SingleMethod getTestMethod(Document doc, int cursor){ SingleMethod sm = null; if (doc != null){ JavaSource js = JavaSource.forDocument(doc); if(js == null) { return null; } TestClassInfoTask task = new TestClassInfoTask(cursor); try { Future<Void> f = js.runWhenScanFinished(task, true); if (f.isDone() && task.getFileObject() != null && task.getMethodName() != null){ sm = new SingleMethod(task.getFileObject(), task.getMethodName()); } } catch (IOException ex) { LOGGER.log(Level.WARNING, null, ex); } } return sm; }
public static SingleMethod getTestMethod(Document doc, int cursor){ SingleMethod sm = null; if (doc != null) { JavaSource js = JavaSource.forDocument(doc); if(js == null) { return null; } TestClassInfoTask task = new TestClassInfoTask(cursor); try { Future<Void> f = js.runWhenScanFinished(task, true); if (f.isDone() && task.getFileObject() != null && task.getMethodName() != null) { sm = new SingleMethod(task.getFileObject(), task.getMethodName()); } } catch (IOException ex) { LOGGER.log(Level.WARNING, null, ex); } } return sm; }
if (panes.length > 0) { final int cursor = panes[0].getCaret().getDot(); JavaSource js = JavaSource.forDocument(panes[0].getDocument()); if(js == null) { return;
if (panes.length > 0) { final int cursor = panes[0].getCaret().getDot(); JavaSource js = JavaSource.forDocument(panes[0].getDocument()); task = new TestClassInfoTask(cursor); try {
if (panes.length > 0) { final int cursor = panes[0].getCaret().getDot(); JavaSource js = JavaSource.forDocument(panes[0].getDocument()); task = new TestClassInfoTask(cursor); try {