Examples of ISelectionStatusValidator


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 rejectedElements = new ArrayList(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

        folderSelectionDialog.setInput(org.apache.uima.caseditor.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

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

    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

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

            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

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

    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

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

  }
  /**
   * Browse for a new Destination Folder
   */
  protected void handleFolderButtonPressed() {
    ISelectionStatusValidator validator = getContainerDialogSelectionValidator();
    ViewerFilter filter = getContainerDialogViewerFilter();
    ITreeContentProvider contentProvider = new WorkbenchContentProvider();
    ILabelProvider labelProvider = new DecoratingLabelProvider(new WorkbenchLabelProvider(), PlatformUI.getWorkbench()
        .getDecoratorManager().getLabelDecorator());
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, contentProvider);
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        return false;
      }
    };
  }
  protected ISelectionStatusValidator getContainerDialogSelectionValidator() {
    return new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
        if (selection != null && selection[0] != null && !(selection[0] instanceof IProject))
          return WTPCommonPlugin.OK_STATUS;
        return WTPCommonPlugin.createErrorStatus(J2EEUIMessages.CONTAINER_SELECTION_DIALOG_VALIDATOR_MESG);
      }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

  }
  /**
   * Browse for a new Destination Folder
   */
  protected void handleFolderButtonPressed() {
    ISelectionStatusValidator validator = getContainerDialogSelectionValidator();
    ViewerFilter filter = getContainerDialogViewerFilter();
    ITreeContentProvider contentProvider = new WorkbenchContentProvider();
    ILabelProvider labelProvider = new DecoratingLabelProvider(new WorkbenchLabelProvider(), PlatformUI.getWorkbench()
        .getDecoratorManager().getLabelDecorator());
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, contentProvider);
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        return false;
      }
    };
  }
  protected ISelectionStatusValidator getContainerDialogSelectionValidator() {
    return new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
        if (selection != null && selection[0] != null && !(selection[0] instanceof IProject))
          return WTPCommonPlugin.OK_STATUS;
        return WTPCommonPlugin.createErrorStatus(J2EEUIMessages.CONTAINER_SELECTION_DIALOG_VALIDATOR_MESG);
      }
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

  }
  /**
   * Browse for a new Destination Folder
   */
  protected void handleFolderButtonPressed() {
    ISelectionStatusValidator validator = getContainerDialogSelectionValidator();
    ViewerFilter filter = getContainerDialogViewerFilter();
    ITreeContentProvider contentProvider = new WorkbenchContentProvider();
    ILabelProvider labelProvider = new DecoratingLabelProvider(new WorkbenchLabelProvider(), PlatformUI.getWorkbench()
        .getDecoratorManager().getLabelDecorator());
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, contentProvider);
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.