Bug 123496 [IDE] Use operation validation API for IDE actions
We should use the Resources/Core operation validation API in the IDE actions for manipulating resources.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/RenameResourceAction.java
Runnable query = new Runnable() {
            public void run() {
                String pathName = destination.getFullPath().makeRelative()
                        .toString();
                result[0] = MessageDialog.openQuestion(shell,
                        RESOURCE_EXISTS_TITLE, MessageFormat.format(
                                RESOURCE_EXISTS_MESSAGE,
                                new Object[] { pathName }));
            }
        };
        shell.getDisplay().syncExec(query);
        return result[0];
    }
    /**
     * Check if the supplied resource is read only or null. If it is then ask the user if they want
     * to continue. Return true if the resource is not read only or if the user has given
     * permission.
     * @return boolean
     */
    private boolean checkReadOnlyAndNull(IResource currentResource) {
        
        if (currentResource == null)
            return false;
        
        if (currentResource.getResourceAttributes().isReadOnly())
            return MessageDialog.openQuestion(getShell(), CHECK_RENAME_TITLE,
                    MessageFormat.format(CHECK_RENAME_MESSAGE,
                            new Object[] { currentResource.getName() }));
        
        return true;