Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator


        WGADesignStructureHelper helper = new WGADesignStructureHelper(syncInfo);       
        dialog.setInput(helper.getTmlRoot());
        dialog.setAllowMultiple(false);
        dialog.setHelpAvailable(false);
        dialog.setTitle("TML layout selection");
        dialog.setValidator(new ISelectionStatusValidator() {
           
            public IStatus validate(Object[] selection) {
                if (selection != null && selection.length == 1) {
                    if (selection[0] instanceof IFile) {
                        return new Status(Status.OK, Plugin.PLUGIN_ID, ((IFile)selection[0]).getFullPath().toString());
View Full Code Here


        setControl(composite);
    }

    void doAdd() {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setValidator(new ISelectionStatusValidator() {
            public IStatus validate(Object[] selection) {
                if (selection.length > 0 && selection[0] instanceof IFile) {
                    return new Status(IStatus.OK, Plugin.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$
                }
                return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, IStatus.ERROR, "", null); //$NON-NLS-1$
View Full Code Here

        }
    }

    void doBrowseBndrun() {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(launchTargetTxt.getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setValidator(new ISelectionStatusValidator() {
            public IStatus validate(Object[] selection) {
                if (selection.length > 0 && selection[0] instanceof IFile) {
                    return new Status(IStatus.OK, Plugin.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$
                }
                return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, IStatus.ERROR, "", null); //$NON-NLS-1$
View Full Code Here

                public Object[] getChildren(Object o) {
                    return new Object[] { project };
                }
            }); // this is the root element
            dialog.setAllowMultiple(false);
            dialog.setValidator(new ISelectionStatusValidator() {

                @Override
                public IStatus validate(Object[] selection) {

                    if (selection.length > 0) {
View Full Code Here

        }

        final FolderSelectionDialog dialog = new FolderSelectionDialog(shell, lp, cp);
        dialog.setTitle(dialogTitle);

        final ISelectionStatusValidator validator = new ISelectionStatusValidator() {
            ISelectionStatusValidator myValidator = new TypedElementSelectionValidator(
                    acceptedClasses, false);

            @Override
            public IStatus validate(final Object[] selection) {
View Full Code Here

        folderSelectionDialog.setInput(CasEditorPlugin.getNlpModel());

        folderSelectionDialog.setTitle("Choose corpus");
        folderSelectionDialog.setMessage("Please choose a corpus.");

        folderSelectionDialog.setValidator(new ISelectionStatusValidator() {
          public IStatus validate(Object[] selection) {

            if (selection.length == 1 && selection[0] instanceof CorpusElement) {
              return new Status(IStatus.OK, CasEditorPlugin.ID, 0, "", null);
            }
View Full Code Here

    fileSelectionDialog.addFilter(new FileElementFilter());
    fileSelectionDialog.setInput(mProject);
    fileSelectionDialog.setTitle(title);
    fileSelectionDialog.setMessage(message);
    fileSelectionDialog.setValidator(new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
        if (selection.length == 1 && selection[0] instanceof IFile) {
          return new Status(IStatus.OK, CasEditorPlugin.ID, 0, "", null);
        }
View Full Code Here

            getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());

    folderSelectionDialog.setInput(mProject);
    folderSelectionDialog.setTitle(getLabelText());
    folderSelectionDialog.setMessage(getPreferenceName());
    folderSelectionDialog.setValidator(new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
        if (selection.length == 1 && selection[0] instanceof IFolder) {
          return new Status(IStatus.OK, CasEditorPlugin.ID, 0, "", null);
        }
View Full Code Here

    folderSelectionDialog.addFilter(new FolderElementFilter());
    folderSelectionDialog.setInput(mProject);
    folderSelectionDialog.setTitle(title);
    folderSelectionDialog.setMessage(message);
    folderSelectionDialog.setValidator(new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
        if (selection.length == 1 && selection[0] instanceof IFolder) {
          return new Status(IStatus.OK, CasEditorPlugin.ID, 0, "", null);
        }
View Full Code Here

                String path = null;
                if (project != null) {
                    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(Display
                            .getDefault().getActiveShell(), new WorkbenchLabelProvider(),
                            new WorkbenchContentProvider());
                    dialog.setValidator(new ISelectionStatusValidator() {
                        private final IStatus errorStatus = new Status(IStatus.ERROR, IvyPlugin.ID,
                                0, "", null);

                        public IStatus validate(Object[] selection) {
                            if (selection.length == 0) {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.dialogs.ISelectionStatusValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.