Search in sources :

Example 1 with ChoiceDialog

use of org.eclipse.che.plugin.svn.ide.common.threechoices.ChoiceDialog in project che by eclipse.

the class LockUnlockPresenter method showDialog.

private void showDialog(final boolean lock) {
    final Project project = appContext.getRootProject();
    checkState(project != null);
    final Resource[] resources = appContext.getResources();
    checkState(!Arrays.isNullOrEmpty(resources));
    final String withoutForceLabel = getWithoutForceLabel(lock);
    final String withForceLabel = getWithForceLabel(lock);
    final String cancelLabel = getCancelLabel(lock);
    final ConfirmCallback withoutForceCallback = new ConfirmCallback() {

        @Override
        public void accepted() {
            doAction(lock, false, toRelative(project, resources));
        }
    };
    final ConfirmCallback withForceCallback = new ConfirmCallback() {

        @Override
        public void accepted() {
            doAction(lock, true, toRelative(project, resources));
        }
    };
    final ChoiceDialog dialog = this.choiceDialogFactory.createChoiceDialog(getTitle(lock), getContent(lock), withoutForceLabel, withForceLabel, cancelLabel, withoutForceCallback, withForceCallback, null);
    dialog.show();
}
Also used : ChoiceDialog(org.eclipse.che.plugin.svn.ide.common.threechoices.ChoiceDialog) Project(org.eclipse.che.ide.api.resources.Project) ConfirmCallback(org.eclipse.che.ide.api.dialogs.ConfirmCallback) Resource(org.eclipse.che.ide.api.resources.Resource)

Aggregations

ConfirmCallback (org.eclipse.che.ide.api.dialogs.ConfirmCallback)1 Project (org.eclipse.che.ide.api.resources.Project)1 Resource (org.eclipse.che.ide.api.resources.Resource)1 ChoiceDialog (org.eclipse.che.plugin.svn.ide.common.threechoices.ChoiceDialog)1