Examples of ISelectionStatusValidator


Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

      //
      dialog.setTitle("Source folder selection");
      dialog.setMessage("Choose a source folder:");
      dialog.setComparator(new ViewerComparator());
      // set validator to accept only package selection
      dialog.setValidator(new ISelectionStatusValidator() {
        public IStatus validate(Object[] selection) {
          if (selection.length == 1) {
            Object element = selection[0];
            if (isElementValid(element)) {
              return StatusUtils.OK_STATUS;
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

    dialog.setTitle("ClientFactory interface selection");
    dialog.setMessage("Choose a ClientFactory interface:");
    dialog.setAllowMultiple(false);
    dialog.setHelpAvailable(false);
    //
    dialog.setValidator(new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
        if (selection.length == 1) {
          if (selection[0] instanceof ICompilationUnit) {
            try {
              if (validateFactoryCompilationUnit((ICompilationUnit) selection[0]) == null) {
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        folderSelectionDialog.setInput(org.apache.uima.caseditor.CasEditorPlugin.getNlpModel());

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

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

            if (selection.length == 1) {
             
              Object selectedElement = selection[0];
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

            new WorkbenchContentProvider());
       
        dialog.setTitle(HTMLPlugin.getResourceString("JavaScriptPropertyPage.ChooseJavaScript"));
        dialog.setMessage(HTMLPlugin.getResourceString("JavaScriptPropertyPage.ChooseJavaScript.Description"));
        dialog.setInput(wsroot);
        dialog.setValidator(new ISelectionStatusValidator(){
          private IStatus okStatus = new Status(Status.OK, HTMLPlugin.getDefault().getPluginId(), Status.OK, "", null);
          private IStatus ngStatus = new Status(Status.ERROR, HTMLPlugin.getDefault().getPluginId(), Status.ERROR, "", null);
         
          public IStatus validate(Object[] selection) {
            for(int i=0;i<selection.length;i++){
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

      IResource init = null;
      if (params.getRoot() != null) {
        init = wsroot.findMember(currProject.getName() + params.getRoot());
      }
      Class[] acceptedClasses = new Class[] { IProject.class, IFolder.class };
      ISelectionStatusValidator validator = new TypedElementSelectionValidator(acceptedClasses, false);
      IProject[] allProjects = wsroot.getProjects();
      ArrayList<IProject> rejectedElements = new ArrayList<IProject>(allProjects.length);
      for (int i = 0; i < allProjects.length; i++) {
        if (!allProjects[i].equals(currProject)) {
          rejectedElements.add(allProjects[i]);
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

           
          }
          return true;
        }
      });
      dialog.setValidator(new ISelectionStatusValidator() {
       
        @Override
        public IStatus validate(Object[] selection) {
          if(selection.length == 1){
            if(selection[0] instanceof IFile){
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

           
          }
          return true;
        }
      });
      dialog.setValidator(new ISelectionStatusValidator() {
       
        @Override
        public IStatus validate(Object[] selection) {
          if(selection.length == 1){
            if(selection[0] instanceof IFile){
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

           
          }
          return true;
        }
      });
      dialog.setValidator(new ISelectionStatusValidator() {
       
        @Override
        public IStatus validate(Object[] selection) {
          if(selection.length == 1){
            if(selection[0] instanceof IFile){
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        dialog.setInput( ResourcesPlugin.getWorkspace().getRoot() );
        dialog.setMessage( Messages.getString("EditorImportConfigurationAction.SelectConfigurationFileToImport") ); //$NON-NLS-1$
        dialog.setTitle( DIALOG_TITLE );
        dialog.setAllowMultiple( false );
        dialog.setStatusLineAboveButtons( false );
        dialog.setValidator( new ISelectionStatusValidator()
        {
            /** The validated status */
            private Status validated = new Status( IStatus.OK, ApacheDS2ConfigurationPluginConstants.PLUGIN_ID,
                IStatus.OK, "", null ); //$NON-NLS-1$

View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        }, new PackageContentProvider(selectOnlySourceFolders));

        this.selectOnlySourceFolders = selectOnlySourceFolders;

        //let's set the validator
        this.setValidator(new ISelectionStatusValidator() {
            public IStatus validate(Object selection[]) {
                if (selection.length > 1) {
                    return new Status(IStatus.ERROR, PydevPlugin.getPluginID(), IStatus.ERROR,
                            "Only one package can be selected", null);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.