public void run(IProgressMonitor pm) throws InvocationTargetException { try { RefactoringCore.getUndoManager().performUndo(query, pm); } catch (CoreException e) { throw new InvocationTargetException(e); } } };
@Override public Refactoring createRefactoring(final RefactoringStatus status) throws CoreException { Refactoring refactoring= null; final String id= getID(); final RefactoringContribution contribution= RefactoringCore.getRefactoringContribution(id); if (contribution != null) { if (contribution instanceof JavaRefactoringContribution) { JavaRefactoringContribution javaContribution= (JavaRefactoringContribution) contribution; refactoring= javaContribution.createRefactoring(this, status); } else JavaManipulationPlugin.log(new Status(IStatus.ERROR, JavaManipulationPlugin.getPluginId(), 0, MessageFormat.format(DescriptorMessages.JavaRefactoringDescriptor_no_resulting_descriptor, new Object[] { id}), null)); } return refactoring; }
public void run(Shell parent) throws InterruptedException, InvocationTargetException { IRunnableContext context= new ProgressMonitorDialog(parent); new RefactoringExecutionHelper(fPasteRefactoring, RefactoringCore.getConditionCheckingFailedSeverity(), RefactoringSaveHelper.SAVE_NOTHING, parent, context).perform(false, false); } }
public void start(BundleContext context) throws Exception { super.start(context); RefactoringCore.internalSetQueryFactory(new UIQueryFactory(RefactoringCore.getQueryFactory())); }
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { RefactoringCore.getHistoryService().writeRefactoringDescriptors(writable, stream, RefactoringDescriptor.NONE, false, monitor); } catch (CoreException exception) { throw new InvocationTargetException(exception); } } });
private IValidationCheckResultQuery getQuery(IAdaptable info, String title) { if (info == null) return RefactoringCore.getQueryFactory().create(null); IValidationCheckResultQuery result= info.getAdapter(IValidationCheckResultQuery.class); if (result != null) return result; ContextAdapter context= new ContextAdapter(info, title); return RefactoringCore.getQueryFactory().create(context); }
/** * {@inheritDoc} */ public final void dispose() { RefactoringCore.getHistoryService().disconnect(); super.dispose(); }
private IValidationCheckResultQuery getQuery(IAdaptable info, String title) { if (info == null) return RefactoringCore.getQueryFactory().create(null); IValidationCheckResultQuery result= (IValidationCheckResultQuery)info.getAdapter(IValidationCheckResultQuery.class); if (result != null) return result; ContextAdapter context= new ContextAdapter(info, title); return RefactoringCore.getQueryFactory().create(context); }
public void run(IProgressMonitor pm) throws InvocationTargetException { try { RefactoringCore.getUndoManager().performRedo(query, pm); } catch (CoreException e) { throw new InvocationTargetException(e); } } };
RefactoringContribution contribution= RefactoringCore.getRefactoringContribution(javaDescriptor.getID());
output= new BufferedOutputStream(new FileOutputStream(file)); try { RefactoringCore.getHistoryService().writeRefactoringDescriptors(proxies, output, RefactoringDescriptor.NONE, false, monitor); try { output.close();
public void run(Shell parent) throws InterruptedException, InvocationTargetException { IRunnableContext context= new ProgressMonitorDialog(parent); new RefactoringExecutionHelper(fPasteRefactoring, RefactoringCore.getConditionCheckingFailedSeverity(), RefactoringSaveHelper.SAVE_NOTHING, parent, context).perform(false, false); } }
private IValidationCheckResultQuery getQuery(IAdaptable info, String title) { if (info == null) return RefactoringCore.getQueryFactory().create(null); IValidationCheckResultQuery result= info.getAdapter(IValidationCheckResultQuery.class); if (result != null) return result; ContextAdapter context= new ContextAdapter(info, title); return RefactoringCore.getQueryFactory().create(context); }
public void dispose() { if (fUndoManagerListener != null) RefactoringCore.getUndoManager().removeListener(fUndoManagerListener); fWorkbenchWindow= null; fAction= null; fUndoManagerListener= null; }
RefactoringContribution contribution= RefactoringCore.getRefactoringContribution(javaDescriptor.getID());
output= new BufferedOutputStream(new FileOutputStream(file)); try { RefactoringCore.getHistoryService().writeRefactoringDescriptors(proxies, output, RefactoringDescriptor.NONE, false, monitor); try { output.close();
public void run(Shell parent) throws InterruptedException, InvocationTargetException { IRunnableContext context= new ProgressMonitorDialog(parent); new RefactoringExecutionHelper(fPasteRefactoring, RefactoringCore.getConditionCheckingFailedSeverity(), RefactoringSaveHelper.SAVE_NOTHING, parent, context).perform(false, false); } }
protected void hookListener(IAction action) { if (isHooked()) return; fAction= action; fUndoManagerListener= createUndoManagerListener(); RefactoringCore.getUndoManager().addListener(fUndoManagerListener); }
@Override public Refactoring createRefactoring(JavaRefactoringDescriptor javaDescriptor, RefactoringStatus status) throws CoreException { if (javaDescriptor instanceof RenameResourceDescriptor) { RenameResourceDescriptor descriptor= (RenameResourceDescriptor) javaDescriptor; // use the LTK RenameResourceDescriptor to create the refactoring RefactoringContribution newContribution= RefactoringCore.getRefactoringContribution(org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor.ID); if (newContribution != null) { RefactoringDescriptor ltkDescriptor= newContribution.createDescriptor(); if (ltkDescriptor instanceof org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor) { ((org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor) ltkDescriptor).setNewName(descriptor.getNewName()); ((org.eclipse.ltk.core.refactoring.resource.RenameResourceDescriptor) ltkDescriptor).setResourcePath(descriptor.getResourcePath()); return ltkDescriptor.createRefactoring(status); } } status.addFatalError(DescriptorMessages.RenameResourceRefactoringContribution_error_cannot_access); } return null; }
output= new BufferedOutputStream(new FileOutputStream(file)); try { RefactoringCore.getHistoryService().writeRefactoringDescriptors(proxies, output, RefactoringDescriptor.NONE, false, monitor); try { output.close();