當前位置: 首頁>>代碼示例>>Java>>正文


Java ElementListSelectionDialog.setHelpAvailable方法代碼示例

本文整理匯總了Java中org.eclipse.ui.dialogs.ElementListSelectionDialog.setHelpAvailable方法的典型用法代碼示例。如果您正苦於以下問題:Java ElementListSelectionDialog.setHelpAvailable方法的具體用法?Java ElementListSelectionDialog.setHelpAvailable怎麽用?Java ElementListSelectionDialog.setHelpAvailable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.ui.dialogs.ElementListSelectionDialog的用法示例。


在下文中一共展示了ElementListSelectionDialog.setHelpAvailable方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: chooseProject

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
private IJavaProject chooseProject() {
	IJavaProject[] projects;
	try {
		projects= JavaCore.create(fWorkspaceRoot).getJavaProjects();
	} catch (JavaModelException e) {
		JavaPlugin.log(e);
		projects= new IJavaProject[0];
	}

	ILabelProvider labelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
	ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
	dialog.setTitle(NewWizardMessages.NewSourceFolderWizardPage_ChooseProjectDialog_title);
	dialog.setMessage(NewWizardMessages.NewSourceFolderWizardPage_ChooseProjectDialog_description);
	dialog.setElements(projects);
	dialog.setInitialSelections(new Object[] { fCurrJProject });
	dialog.setHelpAvailable(false);
	if (dialog.open() == Window.OK) {
		return (IJavaProject) dialog.getFirstResult();
	}
	return null;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:22,代碼來源:NewSourceFolderWizardPage.java

示例2: selectClass

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
 * @param shell
 * @param project
 * @param filter
 * @return the selected file
 */
public static IType selectClass(final Shell shell,
        final IProject project,
        final Filter filter) {
    final int flags = JavaElementLabelProvider.SHOW_DEFAULT |
            JavaElementLabelProvider.SHOW_POST_QUALIFIED |
            JavaElementLabelProvider.SHOW_ROOT;
    final ElementListSelectionDialog dlg =
            new ElementListSelectionDialog(shell, new JavaElementLabelProvider(flags));
    dlg.setTitle("Select Custom Operation(s) Class");
    dlg.setMessage("Select a custom operation(s) class");
    dlg.setMatchEmptyString(true);
    dlg.setHelpAvailable(false);
    final List<IType> types = new ArrayList<>();
    populateClasses(shell, JavaCore.create(project), types, filter);
    dlg.setElements(types.toArray());
    return (dlg.open() == Window.OK) ? (IType) dlg.getFirstResult() : null;
}
 
開發者ID:fabric8io,項目名稱:data-mapper,代碼行數:24,代碼來源:Util.java

示例3: choosePackage

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
protected IPackageFragment choosePackage() {
	IPackageFragmentRoot froot = getPackageFragmentRoot();
	IJavaElement[] packages = null;
	try {
		if (froot != null && froot.exists()) {
			packages = froot.getChildren();
		}
	} catch (JavaModelException e) {
		JavaPlugin.log(e);
	}
	if (packages == null) {
		packages = new IJavaElement[0];
	}

	ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(
			JavaElementLabelProvider.SHOW_DEFAULT));
	dialog.setIgnoreCase(false);
	dialog.setTitle(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_title);
	dialog.setMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_description);
	dialog.setEmptyListMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_empty);
	dialog.setElements(packages);
	dialog.setHelpAvailable(false);
	if (dialog.open() == Window.OK) {
		return (IPackageFragment) dialog.getFirstResult();
	}
	return null;
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:28,代碼來源:ExportToJavaBeanWizardPage.java

示例4: chooseProject

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
private IJavaProject chooseProject() {
  IJavaProject[] javaProjects;

  try {
    javaProjects = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
  } catch (JavaModelException e) {
    GWTPluginLog.logError(e);
    javaProjects = new IJavaProject[0];
  }

  // Filter the list to only show GWT projects
  List<IJavaProject> gwtProjects = new ArrayList<IJavaProject>();
  for (IJavaProject javaProject : javaProjects) {
    if (GWTNature.isGWTProject(javaProject.getProject())) {
      gwtProjects.add(javaProject);
    }
  }

  ILabelProvider labelProvider = new JavaElementLabelProvider(
      JavaElementLabelProvider.SHOW_DEFAULT);
  ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
  dialog.setTitle("Project Selection");
  dialog.setMessage("Choose a project to compile");
  dialog.setElements(gwtProjects.toArray(new IJavaProject[0]));
  dialog.setInitialSelections(new Object[] {JavaCore.create(project)});

  dialog.setHelpAvailable(false);
  if (dialog.open() == Window.OK) {
    return (IJavaProject) dialog.getFirstResult();
  }
  return null;
}
 
開發者ID:gwt-plugins,項目名稱:gwt-eclipse-plugin,代碼行數:33,代碼來源:GWTCompileDialog.java

示例5: choosePackage

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
private IPackageFragment choosePackage() {
  IPackageFragmentRoot root = getPackageFragmentRoot();
  IJavaElement[] packages = null;
  try {
    if (root != null && root.exists()) {
      packages = root.getChildren();
    }
  } catch (JavaModelException e) {
    JavaPlugin.log(e);
  }
  if (packages == null) {
    packages = new IJavaElement[0];
  }

  ElementListSelectionDialog dialog = new ElementListSelectionDialog(
      getShell(), new JavaElementLabelProvider(
          JavaElementLabelProvider.SHOW_DEFAULT));
  dialog.setIgnoreCase(false);
  dialog.setTitle(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_title);
  dialog.setMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_description);
  dialog.setEmptyListMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_empty);
  dialog.setElements(packages);
  dialog.setHelpAvailable(false);

  if (dialog.open() == Window.OK) {
    return (IPackageFragment) dialog.getFirstResult();
  }
  return null;
}
 
開發者ID:gwt-plugins,項目名稱:gwt-eclipse-plugin,代碼行數:30,代碼來源:NewModuleWizardPage.java

示例6: chooseProject

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
private IJavaProject chooseProject() {
  IJavaProject[] projects;
  try {
    projects = JavaCore.create(Util.getWorkspaceRoot()).getJavaProjects();
  } catch (JavaModelException e) {
    JavaPlugin.log(e);
    projects = new IJavaProject[0];
  }

  // Filter the list to only show GWT projects
  List<IJavaProject> gwtProjects = new ArrayList<IJavaProject>();
  for (IJavaProject project : projects) {
    if (GWTNature.isGWTProject(project.getProject())) {
      gwtProjects.add(project);
    }
  }

  // TODO: refactor this into utility function
  ILabelProvider labelProvider = new JavaElementLabelProvider(
      JavaElementLabelProvider.SHOW_DEFAULT);
  ElementListSelectionDialog dialog = new ElementListSelectionDialog(
      getShell(), labelProvider);
  dialog.setTitle("Project Selection");
  dialog.setMessage("Choose a project for the new HTML page");
  dialog.setElements(gwtProjects.toArray(new IJavaProject[0]));
  dialog.setInitialSelections(new Object[] {getJavaProject()});
  dialog.setHelpAvailable(false);
  if (dialog.open() == Window.OK) {
    return (IJavaProject) dialog.getFirstResult();
  }
  return null;
}
 
開發者ID:gwt-plugins,項目名稱:gwt-eclipse-plugin,代碼行數:33,代碼來源:NewHostPageWizardPage.java

示例7: choosePackage

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
 * Opens a selection dialog that allows to select a package.
 *
 * @return returns the selected package or <code>null</code> if the dialog has been canceled.
 * The caller typically sets the result to the package input field.
 * <p>
 * Clients can override this method if they want to offer a different dialog.
 * </p>
 *
 * @since 3.2
 */
protected IPackageFragment choosePackage() {
	IPackageFragmentRoot froot= getPackageFragmentRoot();
	IJavaElement[] packages= null;
	try {
		if (froot != null && froot.exists()) {
			packages= froot.getChildren();
		}
	} catch (JavaModelException e) {
		JavaPlugin.log(e);
	}
	if (packages == null) {
		packages= new IJavaElement[0];
	}

	ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT));
	dialog.setIgnoreCase(false);
	dialog.setTitle(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_title);
	dialog.setMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_description);
	dialog.setEmptyListMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_empty);
	dialog.setElements(packages);
	dialog.setHelpAvailable(false);

	IPackageFragment pack= getPackageFragment();
	if (pack != null) {
		dialog.setInitialSelections(new Object[] { pack });
	}

	if (dialog.open() == Window.OK) {
		return (IPackageFragment) dialog.getFirstResult();
	}
	return null;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:44,代碼來源:NewTypeWizardPage.java

示例8: chooseProject

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
    * Display a list of projects in the workspace and return the selected one.
    */
@VisibleForTesting
public IProject chooseProject() {
   	// Get all projects in workspace
       ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new LabelProvider() {
           @Override
           public String getText(Object element) {
           	if (Utils.isNotEmpty(element) && element instanceof IProject) {
           		return ((IProject) element).getName();
           	}
           	return "";
           }
       });
       
       // Display the projects in dialog. If there is none, user cannot launch config.
       dialog.setTitle(Messages.Tab_ProjectDialogTitle);
       dialog.setMessage(Messages.Tab_ProjectDialogInstruction);
       dialog.setHelpAvailable(false);
       dialog.setElements(ContainerDelegate.getInstance().getServiceLocator().getProjectService().getForceProjects()
               .toArray());

       if (dialog.open() == Window.OK) {
           return (IProject) dialog.getFirstResult();
       }

       return null;
   }
 
開發者ID:forcedotcom,項目名稱:idecore,代碼行數:30,代碼來源:ProjectConfigurationTab.java

示例9: chooseTestClass

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
    * Display a list of test classes in the project and return
    * the selected one.
    * @return Name of test class
    */
@VisibleForTesting
public String chooseTestClass() {
   	// Display the test classes in dialog
   	ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new LabelProvider() {
           @Override
           public String getText(Object element) {
               if (Utils.isNotEmpty(element) && element instanceof Test) {
               	return ((Test) element).getClassName();
               }
               return "";
           }
       });
   	
   	dialog.setTitle(Messages.Tab_ClassDialogTitle);
       dialog.setMessage(Messages.Tab_ClassDialogInstruction);
       dialog.setHelpAvailable(false);
       IProject selectedProject = projectTab.getProjectFromName();
       TestsHolder rt = allTests.get(selectedProject);
       // We already got the test classes earlier so just display them
       if (rt != null && rt.getTests() != null && !rt.getTests().isEmpty()) {
       	dialog.setElements(rt.getTests().toArray());
       }
       
       if (dialog.open() == Window.OK) {
           return ((Test) dialog.getFirstResult()).getClassName();
       }
   	
   	return null;
   }
 
開發者ID:forcedotcom,項目名稱:idecore,代碼行數:35,代碼來源:TestConfigurationTab.java

示例10: chooseTestMethod

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
    * Display a list of test methods in the test class and return
    * the selected one.
    * @return Name of test method
    */
@VisibleForTesting
public String chooseTestMethod() {
   	// We already got test methods earlier so just display the ones
   	// for previously specified test class
   	List<String> testMethodNames = Lists.newArrayList();
   	IProject selectedProject = projectTab.getProjectFromName();
       TestsHolder rt = allTests.get(selectedProject);
   	for (Test test : rt.getTests()) {
   		if (test.getClassName().equals(getTestClassName())) {
   			testMethodNames = test.getTestMethods();
   		}
   	}
   	
   	// Display the test methods in dialog
   	ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new LabelProvider() {
           @Override
           public String getText(Object element) {
               if (Utils.isEmpty(element)) {
                   return "";
               }
               
               return element.toString();
           }
       });
   	
   	dialog.setTitle(Messages.Tab_MethodDialogTitle);
   	dialog.setMessage(Messages.Tab_MethodDialogInstruction);
   	dialog.setHelpAvailable(false);
   	if (testMethodNames != null && !testMethodNames.isEmpty()) {
   		dialog.setElements(testMethodNames.toArray());
   	}
   	
   	if (dialog.open() == Window.OK) {
   		return dialog.getFirstResult().toString();
   	}
   	
   	return null;
   }
 
開發者ID:forcedotcom,項目名稱:idecore,代碼行數:44,代碼來源:TestConfigurationTab.java

示例11: selectFile

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
 * @param shell
 * @param project
 * @param schemaType
 * @return the selected file
 */
public static String selectFile(final Shell shell,
        final IProject project,
        final String schemaType) {
    final int flags = JavaElementLabelProvider.SHOW_DEFAULT
            | JavaElementLabelProvider.SHOW_POST_QUALIFIED
            | JavaElementLabelProvider.SHOW_ROOT;
    final ElementListSelectionDialog dlg =
            new ElementListSelectionDialog(shell, new JavaElementLabelProvider(flags) {

                @Override
                public String getText(final Object element) {
                    return super.getText(element) + " - "
                            + ((IResource) element).getParent().getFullPath().makeRelative();
                }
            });
    dlg.setTitle("Select " + schemaType);
    dlg.setMessage("Select the " + schemaType + " file for the transformation");
    dlg.setMatchEmptyString(true);
    dlg.setHelpAvailable(false);
    final List<IResource> resources = new ArrayList<>();
    populateResources(shell, project, resources);
    dlg.setElements(resources.toArray());
    if (dlg.open() == Window.OK)
        return ((IFile) dlg.getFirstResult()).getProjectRelativePath().toString();
    return null;
}
 
開發者ID:fabric8io,項目名稱:data-mapper,代碼行數:33,代碼來源:Util.java


注:本文中的org.eclipse.ui.dialogs.ElementListSelectionDialog.setHelpAvailable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。