@Override public Change perform(IProgressMonitor pm) throws CoreException { try { UndoEdit redo= performEdits(); Change result= new UndoDocumentChange(getName(), fDocument, redo); return result; } catch (MalformedTreeException e) { throw Changes.asCoreException(e); } catch (BadLocationException e) { throw Changes.asCoreException(e); } }
@Override public String getName() { return Messages.format(RefactoringCoreMessages.RenameResourceChange_name, new String[] { BasicElementLabels.getPathLabel(fResourcePath, false), BasicElementLabels.getResourceName(fNewName) }); }
public static IUndoManager getUndoManager() { if (fgUndoManager == null) fgUndoManager= createUndoManager(); return fgUndoManager; }
private void logMalfunctioningParticipant(RefactoringStatus status, ParticipantDescriptor descriptor, Throwable e) { status.addError(Messages.format( RefactoringCoreMessages.ParticipantExtensionPoint_participant_removed, descriptor.getName())); RefactoringCorePlugin.logRemovedParticipant(descriptor, e); }
/** * Ends the transformation of the current refactoring. * <p> * If no refactoring is currently processed, this call has no effect. * </p> */ public void endRefactoring() { if (fRefactoring != null && fRefactoringArguments != null) addArguments(fRefactoring, fRefactoringArguments); fRefactoringArguments= null; fRefactoring= null; }
@Override public void handleException(Throwable exception) { RefactoringCorePlugin.log(exception); } });
@Override public final void dispose() { if (fValidationState != null) { fValidationState.dispose(); } }
/** * Returns the singleton undo manager for the refactoring undo stack. * * @return the refactoring undo manager. */ public static IUndoManager getUndoManager() { return RefactoringCorePlugin.getUndoManager(); }
/** * Returns the label for a file pattern like '*.java' * * @param name the pattern * @return the label of the pattern. */ public static String getFilePattern(String name) { return markLTR(name, "*.?/\\:."); //$NON-NLS-1$ }
@Override public Throwable getCause() { // support proper 1.4-style exception chaining return getException(); } };
public static boolean containsOnlyNonProjects(IResource[] resources) { int types = getSelectedResourceTypes(resources); // check for empty selection if (types == 0) { return false; } // note that the selection may contain multiple types of resource return (types & IResource.PROJECT) == 0; }
private void logMalfunctioningParticipant(RefactoringStatus status, ParticipantDescriptor descriptor, Throwable e) { status.addError(Messages.format( RefactoringCoreMessages.ParticipantExtensionPoint_participant_removed, descriptor.getName())); RefactoringCorePlugin.logRemovedParticipant(descriptor, e); }
@Override public Change perform(IProgressMonitor pm) throws CoreException { try { UndoEdit redo= performEdits(); Change result= new UndoDocumentChange(getName(), fDocument, redo); return result; } catch (MalformedTreeException e) { throw Changes.asCoreException(e); } catch (BadLocationException e) { throw Changes.asCoreException(e); } }
@Override public String getName() { return Messages.format(RefactoringCoreMessages.RenameResourceChange_name, new String[] { BasicElementLabels.getPathLabel(fResourcePath, false), BasicElementLabels.getResourceName(fNewName) }); }
public static IUndoManager getUndoManager() { if (fgUndoManager == null) fgUndoManager= createUndoManager(); return fgUndoManager; }
/** * Ends the transformation of the current refactoring. * <p> * If no refactoring is currently processed, this call has no effect. * </p> */ public void endRefactoring() { if (fRefactoring != null && fRefactoringArguments != null) addArguments(fRefactoring, fRefactoringArguments); fRefactoringArguments= null; fRefactoring= null; }
@Override public void handleException(Throwable exception) { RefactoringCorePlugin.log(exception); } });
/** * Returns the label for a file pattern like '*.java' * * @param name the pattern * @return the label of the pattern. */ public static String getFilePattern(String name) { return markLTR(name, "*.?/\\:."); //$NON-NLS-1$ }
private void logMalfunctioningParticipant(RefactoringStatus status, ParticipantDescriptor descriptor, Throwable e) { status.addError(Messages.format( RefactoringCoreMessages.ParticipantExtensionPoint_participant_removed, descriptor.getName())); RefactoringCorePlugin.logRemovedParticipant(descriptor, e); }
/** * Returns a label for a resource name. * * @param resourceName the resource name * @return the label of the resource name. */ public static String getResourceName(String resourceName) { return markLTR(resourceName, ":."); //$NON-NLS-1$ }