Search in sources :

Example 1 with SvnWizardSetPropertyPage

use of org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardSetPropertyPage in project subclipse by subclipse.

the class SvnPropertiesView method getAddPropertyAction.

private Action getAddPropertyAction() {
    if (addPropertyAction == null) {
        SVNUIPlugin plugin = SVNUIPlugin.getPlugin();
        addPropertyAction = new Action(Policy.bind("SvnPropertiesView.addPropertyLabel"), // $NON-NLS-1$
        plugin.getImageDescriptor(ISVNUIConstants.IMG_MENU_PROPSET)) {

            public void run() {
                SvnWizardSetPropertyPage setPropertyPage = new SvnWizardSetPropertyPage(resource);
                SvnWizard wizard = new SvnWizard(setPropertyPage);
                SvnWizardDialog dialog = new SvnWizardDialog(getSite().getShell(), wizard);
                wizard.setParentDialog(dialog);
                if (dialog.open() != SvnWizardDialog.OK)
                    return;
                try {
                    if (setPropertyPage.getPropertyValue() != null) {
                        resource.setSvnProperty(setPropertyPage.getPropertyName(), setPropertyPage.getPropertyValue(), setPropertyPage.getRecurse());
                    } else {
                        resource.setSvnProperty(setPropertyPage.getPropertyName(), setPropertyPage.getPropertyFile(), setPropertyPage.getRecurse());
                    }
                    refresh();
                } catch (SVNException e) {
                    if (!e.operationInterrupted()) {
                        SVNUIPlugin.openError(getSite().getShell(), // $NON-NLS-1$
                        Policy.bind("SvnPropertiesView.errorAddTitle"), // $NON-NLS-1$
                        Policy.bind("SvnPropertiesView.errorAddMessage"), e);
                    }
                }
            }
        };
        addPropertyAction.setToolTipText(// $NON-NLS-1$
        Policy.bind("SvnPropertiesView.addPropertyTooltip"));
    }
    return addPropertyAction;
}
Also used : SVNUIPlugin(org.tigris.subversion.subclipse.ui.SVNUIPlugin) SVNPropertyDeleteAction(org.tigris.subversion.subclipse.ui.actions.SVNPropertyDeleteAction) SVNPropertyModifyAction(org.tigris.subversion.subclipse.ui.actions.SVNPropertyModifyAction) Action(org.eclipse.jface.action.Action) SvnWizardDialog(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardDialog) SvnWizard(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizard) SVNException(org.tigris.subversion.subclipse.core.SVNException) SvnWizardSetPropertyPage(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardSetPropertyPage)

Aggregations

Action (org.eclipse.jface.action.Action)1 SVNException (org.tigris.subversion.subclipse.core.SVNException)1 SVNUIPlugin (org.tigris.subversion.subclipse.ui.SVNUIPlugin)1 SVNPropertyDeleteAction (org.tigris.subversion.subclipse.ui.actions.SVNPropertyDeleteAction)1 SVNPropertyModifyAction (org.tigris.subversion.subclipse.ui.actions.SVNPropertyModifyAction)1 SvnWizard (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizard)1 SvnWizardDialog (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardDialog)1 SvnWizardSetPropertyPage (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardSetPropertyPage)1