Package org.eclipse.ui.dialogs

Examples of org.eclipse.ui.dialogs.ElementTreeSelectionDialog.addFilter()


                return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, IStatus.ERROR, "", null); //$NON-NLS-1$
            }
        });
        dialog.setAllowMultiple(true);
        dialog.setTitle("JAR File Selection");
        dialog.addFilter(new FileExtensionFilter("jar")); //$NON-NLS-1$
        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());

        if (dialog.open() == Window.OK) {
            Object[] result = dialog.getResult();
            List<File> added = new ArrayList<File>(result.length);
View Full Code Here


            }
        });
        dialog.setAllowMultiple(false);
        dialog.setTitle("Run File Selection");
        dialog.setMessage("Select the Run File to launch.");
        dialog.addFilter(new FileExtensionFilter(LaunchConstants.EXT_BNDRUN));
        dialog.setInput(ResourcesPlugin.getWorkspace());

        if (dialog.open() == Window.OK) {
            Object[] files = dialog.getResult();
            if (files != null && files.length == 1) {
View Full Code Here

    private void doAddJar() {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getSection().getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setAllowMultiple(true);
        dialog.setTitle("JAR Selection");
        dialog.setMessage("Select JAR Files to add to the Classpath.");
        dialog.addFilter(new FileExtensionFilter("jar")); //$NON-NLS-1$

        IResource resource = getInputResource();
        dialog.setInput(resource.getProject());

        if (dialog.open() == Window.OK) {
View Full Code Here

    private void doAddFolder() {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getSection().getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
        dialog.setAllowMultiple(true);
        dialog.setTitle("Class Folder Selection");
        dialog.setMessage("Select Class Folders to add to the Classpath.");
        dialog.addFilter(new ClassFolderFilter());

        IResource resource = getInputResource();
        dialog.setInput(resource.getProject());

        if (dialog.open() == Window.OK) {
View Full Code Here

                    .getInferredContentProjectContentRoot(project);
            if (initialContainer != null) {
                dialog.setInitialElementSelections(Arrays
                        .asList(initialContainer));
            }
            dialog.addFilter(new ViewerFilter() {

                @Override
                public boolean select(Viewer viewer, Object parentElement,
                        Object element) {
                    if (element instanceof IProject) {
View Full Code Here

    ElementTreeSelectionDialog dialog =
        new ElementTreeSelectionDialog(getControl().getShell(),
            new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_BASICS),
            new JavaPackageElementContentProvider());
    dialog.setInput(project);
    dialog.addFilter(new ViewerFilter() {

      @Override
      public boolean select(Viewer viewer, Object parentElement, Object element) {
        if (element instanceof IPackageFragment) {
          return !((IPackageFragment) element).getElementName().equals("");
View Full Code Here

        final ElementTreeSelectionDialog folderSelectionDialog = new ElementTreeSelectionDialog(
                getShell(), new DecoratingLabelProvider(new WorkbenchLabelProvider(), PlatformUI
                        .getWorkbench().getDecoratorManager().getLabelDecorator()),
                new BaseWorkbenchContentProvider());

        folderSelectionDialog.addFilter(new CorpusElementFilter());

        if (corpusElement != null) {
          folderSelectionDialog.setInitialSelection(corpusElement);
        }
View Full Code Here

    // TODO: preselect entered text entry

    final ElementTreeSelectionDialog fileSelectionDialog = new ElementTreeSelectionDialog(
            getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());

    fileSelectionDialog.addFilter(new FileElementFilter());
    fileSelectionDialog.setInput(mProject);
    fileSelectionDialog.setTitle(title);
    fileSelectionDialog.setMessage(message);
    fileSelectionDialog.setValidator(new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
View Full Code Here

  @Override
  protected String getNewInputObject() {
    final ElementTreeSelectionDialog folderSelectionDialog = new ElementTreeSelectionDialog(
            getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());

    folderSelectionDialog.addFilter(new FolderElementFilter());
    folderSelectionDialog.setInput(mProject);
    folderSelectionDialog.setTitle(title);
    folderSelectionDialog.setMessage(message);
    folderSelectionDialog.setValidator(new ISelectionStatusValidator() {
      public IStatus validate(Object[] selection) {
View Full Code Here

        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
                new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
        dialog.setTitle("Select a file in the project:");
        dialog.setMessage("Select a file in the project:");
        // Filter to the project
        dialog.addFilter(new ViewerFilter() {
            public boolean select(Viewer viewer, Object parentElement, Object element) {
                if (element instanceof IProject) {
                    return ((IProject) element).getName().equals(project.getName());
                }
                if (defaultExtension == 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.