@Override protected IStatus run(IProgressMonitor monitor) { try { fAccessorTypes.put(getEditorInput(), findAccessorType(monitor)); } catch (JavaModelException e) { JavaPlugin.log(e); } return Status.OK_STATUS; } };
@Override protected IStatus run(IProgressMonitor monitor) { try { fAccessorTypes.put(getEditorInput(), findAccessorType(monitor)); } catch (JavaModelException e) { JavaPlugin.log(e); } return Status.OK_STATUS; } };
private boolean checkEnabled(ITextSelection selection) { if (selection == null || selection.isEmpty()) return false; // XXX: Must be changed to IStorageEditorInput once support for JARs is available (see class Javadoc for details) return fEditor.getEditorInput() instanceof IFileEditorInput; }
public IType getAccessorType() { if (fJob != null) { try { fJob.join(); } catch (InterruptedException e) { JavaPlugin.log(e); } } return fAccessorTypes.get(getEditorInput()); }
public IType getAccessorType() { if (fJob != null) { try { fJob.join(); } catch (InterruptedException e) { JavaPlugin.log(e); } } return fAccessorTypes.get(getEditorInput()); }
/** * Creates a new <code>OpenAction</code>. * * @param editor the Properties file editor which provides the context information for this action */ public OpenAction(PropertiesFileEditor editor) { super(editor.getEditorSite()); fEditor= editor; setText(PropertiesFileEditorMessages.OpenAction_label); setToolTipText(PropertiesFileEditorMessages.OpenAction_tooltip); // XXX: Must be removed once support for JARs is available (see class Javadoc for details). setEnabled(fEditor.getEditorInput() instanceof IFileEditorInput); }
@Override protected void doSetInput(IEditorInput input) throws CoreException { super.doSetInput(input); if (fJob != null) fJob.cancel(); fFile= getEditorInput().getAdapter(IFile.class); if (fFile == null) return; if (fJob == null) { fJob= new Job(PropertiesFileEditorMessages.PropertiesFileEditor_find_accessor_type) { @Override protected IStatus run(IProgressMonitor monitor) { try { fAccessorTypes.put(getEditorInput(), findAccessorType(monitor)); } catch (JavaModelException e) { JavaPlugin.log(e); } return Status.OK_STATUS; } }; fJob.setSystem(true); } fJob.schedule(); }
@Override protected void doSetInput(IEditorInput input) throws CoreException { super.doSetInput(input); if (fJob != null) fJob.cancel(); fFile= getEditorInput().getAdapter(IFile.class); if (fFile == null) return; if (fJob == null) { fJob= new Job(PropertiesFileEditorMessages.PropertiesFileEditor_find_accessor_type) { @Override protected IStatus run(IProgressMonitor monitor) { try { fAccessorTypes.put(getEditorInput(), findAccessorType(monitor)); } catch (JavaModelException e) { JavaPlugin.log(e); } return Status.OK_STATUS; } }; fJob.setSystem(true); } fJob.schedule(); }