当前位置: 首页>>代码示例>>Java>>正文


Java ElementListSelectionDialog.setMessage方法代码示例

本文整理汇总了Java中org.eclipse.ui.dialogs.ElementListSelectionDialog.setMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ElementListSelectionDialog.setMessage方法的具体用法?Java ElementListSelectionDialog.setMessage怎么用?Java ElementListSelectionDialog.setMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.dialogs.ElementListSelectionDialog的用法示例。


在下文中一共展示了ElementListSelectionDialog.setMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: chooseGW4EProject

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
public static IJavaProject chooseGW4EProject(IJavaProject javaProject) {
	Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
	IJavaProject[] projects = getGW4EProjects();
	ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
	dialog.setTitle(MessageUtil.getString("projectdialog_title"));
	dialog.setMessage(MessageUtil.getString("projectdialog_message"));
	dialog.setElements(projects);

	if (javaProject != null) {
		dialog.setInitialSelections(new Object[] { javaProject });
	}
	if (dialog.open() == Window.OK) {
		return (IJavaProject) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:18,代码来源:GraphWalkerContextManager.java

示例2: chooseConfig

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
/**
 * Prompts the user to choose from the list of given launch configurations
 * and returns the config the user choose or <code>null</code> if the user
 * pressed Cancel or if the given list is empty.
 * 
 * @param configs
 *            the list of {@link ILaunchConfiguration}s to choose from
 * @return the chosen {@link ILaunchConfiguration} or <code>null</code>
 */
public static ILaunchConfiguration chooseConfig(
		List<ILaunchConfiguration> configs) {
	if (configs.isEmpty()) {
		return null;
	}
	ILabelProvider labelProvider = DebugUITools.newDebugModelPresentation();
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			Display.getDefault().getActiveShell(), labelProvider);
	dialog.setElements(configs.toArray(new ILaunchConfiguration[configs
			.size()]));
	dialog.setTitle(JSBuildFileLaunchConfigurationMessages.AntLaunchShortcut_4);
	dialog.setMessage(JSBuildFileLaunchConfigurationMessages.AntLaunchShortcut_5);
	dialog.setMultipleSelection(false);
	int result = dialog.open();
	labelProvider.dispose();
	if (result == Window.OK) {
		return (ILaunchConfiguration) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:angelozerr,项目名称:jsbuild-eclipse,代码行数:30,代码来源:JSBuildFileLaunchShortcut.java

示例3: selectElement

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			StatemachineDiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.StatemachineModelingAssistantProviderMessage);
	dialog.setTitle(Messages.StatemachineModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:21,代码来源:StatemachineModelingAssistantProvider.java

示例4: chooseConfiguration

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
/**
 * Returns a configuration from the given collection of configurations that should be launched,
 * or <code>null</code> to cancel.
 *
 * @param configList list of configurations to choose from
 * @return configuration to launch or <code>null</code> to cancel
 */
private ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configList) {
        if (configList.size() == 1) {
                return (ILaunchConfiguration) configList.get(0);
        }
        IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
        
        ElementListSelectionDialog dialog= new ElementListSelectionDialog(Display.getCurrent().getActiveShell(),
        				labelProvider);
        dialog.setElements(configList.toArray());
        dialog.setTitle("Select Configuraiton"); //$NON-NLS-1$
        dialog.setMessage("&Select an existing configuration:"); //$NON-NLS-1$
        dialog.setMultipleSelection(false);
        int result = dialog.open();
        labelProvider.dispose();
        if (result == Window.OK) {
                return (ILaunchConfiguration) dialog.getFirstResult();
        }
        return null;            
}
 
开发者ID:scribble,项目名称:scribble-eclipse,代码行数:27,代码来源:SimulationLauncherShortcut.java

示例5: selectPreferences

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
private Preferences selectPreferences(String title) throws Exception {
	String[] sa = pref.childrenNames();
	if (sa.length == 0){
		return null;
	}
	Preferences[] pa = new Preferences[sa.length];
	for (int i = 0; i < pa.length; i++) {
		pa[i] = pref.node(sa[i]);
	}
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(fAccessText.getShell(), new PLP());
	dialog.setTitle(title);
	dialog.setElements(pa);
	dialog.setMessage("Type to filter by name:");
	dialog.setMultipleSelection(false);
	if (dialog.open() == ElementListSelectionDialog.OK) {
		return (Preferences)dialog.getResult()[0];
	}
	return null;
}
 
开发者ID:BeckYang,项目名称:TeamFileList,代码行数:20,代码来源:CustomUnpackMgr.java

示例6: deletePre

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
private void deletePre() {
	try {
		String[] sa = pref.node("fileList").keys();
		if (sa.length == 0){
			return;
		}
		ElementListSelectionDialog dialog = new ElementListSelectionDialog(input.getShell(), new LabelProvider());
		dialog.setTitle("Select file list that you want to remove");
		dialog.setElements(sa);
		dialog.setMessage("Type to filter by name:");
		dialog.setMultipleSelection(true);
		if (dialog.open() == ElementListSelectionDialog.OK) {
			Object[] oa = dialog.getResult();
			Preferences p = pref.node("fileList");
			for (int i = 0; i < oa.length; i++) {
				String key = (String)oa[i];
				remove(key);
				p.remove(key);
			}
			pref.put("selectedList", "");
		}
	} catch (Exception e) {
		TFMPlugin.error("FileListMenuMgr deletePre", e);
	}
}
 
开发者ID:BeckYang,项目名称:TeamFileList,代码行数:26,代码来源:FileListMenuMgr.java

示例7: setUpBrowseProjectDialog

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
private void setUpBrowseProjectDialog() {
  ILabelProvider projectLabelProvider = new BrowseProjectLabelProvider();

  IJavaProject[] javaProjects = javaProjectHelper.getJavaProjects();

  ElementListSelectionDialog dialog =
      new ElementListSelectionDialog(getControl().getShell(), projectLabelProvider);
  dialog.setMessage("Choose a project to run testability on:");

  if (javaProjects != null) {
    dialog.setElements(javaProjects);
  }

  if (dialog.open() == Window.OK) {
    IJavaProject project = (IJavaProject) dialog.getFirstResult();
    projectText.setText(project.getElementName());
    setTabDirty();
  }
}
 
开发者ID:mhevery,项目名称:testability-explorer,代码行数:20,代码来源:TestabilityLaunchConfigurationTab.java

示例8: chooseConfiguration

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
/**
 * Returns a configuration from the given collection of configurations that
 * should be launched, or <code>null</code> to cancel. Default implementation
 * opens a selection dialog that allows the user to choose one of the
 * specified launch configurations. Returns the chosen configuration, or
 * <code>null</code> if the user cancels.
 * 
 * @param configList list of configurations to choose from
 * @return configuration to launch or <code>null</code> to cancel
 */
public static ILaunchConfiguration chooseConfiguration(
    List<ILaunchConfiguration> configList, Shell shell) {
  IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
  try {
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell,
        labelProvider);
    dialog.setElements(configList.toArray());
    dialog.setTitle("Choose a launch configuration:");
    dialog.setMessage("More than one launch configuration is applicable; please choose one:");
    dialog.setMultipleSelection(false);
    int result = dialog.open();
    if (result == Window.OK) {
      return (ILaunchConfiguration) dialog.getFirstResult();
    }
    return null;
  } finally {
    labelProvider.dispose();
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:30,代码来源:LaunchConfigurationUtilities.java

示例9: chooseJavaProject

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
/**
 * Shows a dialog to choose the {@link IJavaProject}.
 *
 * @return the chosen {@link IJavaProject}
 */
private IJavaProject chooseJavaProject() {
	final ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
	final ElementListSelectionDialog dialog = new ElementListSelectionDialog(this.getShell(), labelProvider);
	dialog.setTitle(LauncherMessages.AbstractJavaMainTab_4);
	dialog.setMessage(LauncherMessages.AbstractJavaMainTab_3);
	try {
		dialog.setElements(JavaCore.create(this.getWorkspaceRoot()).getJavaProjects());
	} catch (final JavaModelException javaModelException) {
		JDIDebugUIPlugin.log(javaModelException);
	}
	final IJavaProject javaProject = this.getJavaProject();
	if (javaProject != null) {
		dialog.setInitialSelections(new Object[] {
			javaProject
		});
	}
	if (dialog.open() == Window.OK) {
		return (IJavaProject) dialog.getFirstResult();
	}
	return null;
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:27,代码来源:ProjectTab.java

示例10: selectDataSource

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
private IConnectionProfile selectDataSource()
{
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			getViewSite().getShell(), new LabelProvider() {
				@Override
				public String getText(Object element)
				{
					IConnectionProfile connectionProfile = (IConnectionProfile) element;
					return connectionProfile.getName();
				}
			});
	dialog.setElements(CommonEclipseUtil.getConnectionProfiles());
	dialog.setTitle("DataSource Explorer");
	dialog.setMessage("Select a datasource");
	dialog.setMultipleSelection(false);
	if (dialog.open() != Window.OK) {
		// this.hideView();
		return null;
	}
	Object[] result = dialog.getResult();
	return result.length > 0 ? (IConnectionProfile) result[0] : null;
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:23,代码来源:QueryDesignerView.java

示例11: 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

示例12: 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-Juno38,代码行数:22,代码来源:NewSourceFolderWizardPage.java

示例13: selectElement

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			SmcDiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.SmcModelingAssistantProviderMessage);
	dialog.setTitle(Messages.SmcModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:21,代码来源:SmcModelingAssistantProvider.java

示例14: selectTable

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
private Table selectTable()
{
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			getViewSite().getShell(), new LabelProvider() {
				@Override
				public String getText(Object element)
				{
					Table table = (Table) element;
					return table.getTableName();
				}
			});
	dialog.setElements(CommonEclipseUtil.getTablesFromProfile(connectionProfile).toArray());
	dialog.setTitle("Tables Explorer");
	dialog.setMessage("Select a table");
	dialog.setMultipleSelection(false);
	if (dialog.open() != Window.OK) {
		return null;
	}
	return (Table) dialog.getFirstResult();
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:21,代码来源:QueryDesignerView.java

示例15: selectElement

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //导入方法依赖的package包/类
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			Wc2014DiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.Wc2014ModelingAssistantProviderMessage);
	dialog.setTitle(Messages.Wc2014ModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
开发者ID:ggxx,项目名称:HelloBrazil,代码行数:21,代码来源:Wc2014ModelingAssistantProvider.java


注:本文中的org.eclipse.ui.dialogs.ElementListSelectionDialog.setMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。