Examples of ISelectionStatusValidator


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

        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
        dialog.setTitle("Architecture Selection");
        dialog.setMessage("Select an architecture:");
        dialog.setComparator(new ViewerComparator());
        dialog.addFilter(new FileExtensionFilter(true,"arch"));
        dialog.setValidator(new ISelectionStatusValidator()
        {
         
          public IStatus validate(Object[] selection)
          {
            if (selection.length == 1 && selection[0] instanceof IFile)
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
        dialog.setTitle("Folder Selection");
        dialog.setMessage("Select a Folder:");
        dialog.setComparator(new ViewerComparator());
        dialog.addFilter(new FolderFilter());
        dialog.setValidator(new ISelectionStatusValidator()
        {
         
          public IStatus validate(Object[] selection)
          {
            if (selection.length == 1 && selection[0] instanceof IFolder)
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        return true;
      }
     
    });
   
    etsd.setValidator(new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
        return (selection.length == 1 && selection[0] instanceof IFile) ? SELECTION_OK_STATUS : SELECTION_NOT_OK_STATUS;
      }
    });
   
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 ProblemsLabelDecorator(null));
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
        shell, provider, new StandardJavaElementContentProvider());
    dialog.setComparator(new JavaElementComparator());
    dialog.setAllowMultiple(false);
    dialog.setValidator(new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
        StatusInfo res = new StatusInfo();
        // only single selection
        if (selection.length == 1 && (selection[0] instanceof IFolder))
          res.setOK();
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        new ProblemsLabelDecorator(null));
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
        shell, provider, new WorkbenchContentProvider());
    dialog.setComparator(new JavaElementComparator());
    dialog.setAllowMultiple(false);
    dialog.setValidator(new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
        StatusInfo res = new StatusInfo();
        // only single selection
        if (selection.length == 1 && (selection[0] instanceof IFolder))
          res.setOK();
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        protected Control createDialogArea(Composite parent) {
          return super.createDialogArea(parent);
        }
      };
      // validator
      selectionDialog.setValidator(new ISelectionStatusValidator() {
        public IStatus validate(Object[] selection) {
          if (selection.length == 1 && selection[0] instanceof ImageBundlePrototypeDescription) {
            return StatusUtils.OK_STATUS;
          } else {
            return StatusUtils.ERROR_STATUS;
View Full Code Here

Examples of org.eclipse.ui.dialogs.ISelectionStatusValidator

        new WorkbenchContentProvider());
    tree.setAllowMultiple(false);
    tree.setInput(ResourcesPlugin.getWorkspace().getRoot());
    tree.setMessage("Please select an existing file:");
    tree.setTitle("Choose an existing file");
    tree.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

            String path = null;
            if (project != null && project.getProject().getLocation() != 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
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.