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


Java ElementListSelectionDialog.setMultipleSelection方法代碼示例

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


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

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

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

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

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

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

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

示例7: showMediaSelection

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
    * Show media selection.
    * 
    * @param excludeItemList
    *            the exclude item list
    * @param owner
    *            the owner
    * @return the list
    */
   private List<MediaNode> showMediaSelection(String[] excludeItemList, Composite owner) {
List<INode> availableMediaList = ((ProjectNode) _collectionNode.getLastParent()).getMediaRootNode().getMediaNodes(excludeItemList);
if (availableMediaList.size() >= 0) {
    ElementListSelectionDialog dialog = new ElementListSelectionDialog(owner.getShell(), new NavigatorLabelProvider());
    dialog.setMultipleSelection(true);
    dialog.setElements(availableMediaList.toArray(new INode[availableMediaList.size()]));
    dialog.setTitle(ResourceLoader.getString("SESSION_PROPERTY_MEDIA_SELECTOR_TITLE"));
    dialog.open();
    Object[] selectedObjects = dialog.getResult();
    List<MediaNode> nodeList = new ArrayList<MediaNode>();
    if (selectedObjects != null) {

	for (Object node : selectedObjects) {
	    nodeList.add((MediaNode) node);
	}
    }
    return nodeList;

} else {
    MessageDialog.openError(owner.getShell(), ResourceLoader.getString("DIALOG_ERROR_TITLE"), ResourceLoader.getString("SESSION_PROPERTY_MEDIA_SELECTOR_NO_MEDIA"));
    return null;
}
   }
 
開發者ID:synergynet,項目名稱:synergyview,代碼行數:33,代碼來源:CollectionEditor.java

示例8: open

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
 * Opens a type selection dialog based on the given <code>title</code> and <code>types</code>.
 * 
 * @param <T> the specific data type to work with
 * @param shell the parent shell
 * @param title the title
 * @param types the types to select from
 * @param selected the type to be selected by default, <b>null</b> for none
 * @return the selected datatype, <b>null</b> if none was selected
 */
@SuppressWarnings("unchecked")
public static <T extends IDatatype> T open(Shell shell, String title, Collection<T> types, T selected) {
    T result = null;
    ElementListSelectionDialog dialog =
        new ElementListSelectionDialog(shell, new TypeLabelProvider());
    dialog.setAllowDuplicates(false);
    dialog.setMultipleSelection(false);
    dialog.setElements(types.toArray());
    dialog.setTitle(title);
    if (null != selected) {
        Object[] initialSelections = new Object[1];
        initialSelections[0] = selected;
        dialog.setInitialSelections(initialSelections);
    }
    if (dialog.open() == Window.OK) {
        result = (T) dialog.getFirstResult();
    }
    return result;
}
 
開發者ID:SSEHUB,項目名稱:EASyProducer,代碼行數:30,代碼來源:TypeSelectionDialog.java

示例9: mouseUp

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
 * Mouse handler to open the dialog.
 *
 * @param e
 *            The mouse event to process.
 */
@Override
public void mouseUp(MouseEvent e) {

    Shell shell = e.widget.getDisplay().getActiveShell();
    List<VPMAnalyzer> availableAnalyzer = Lists.newArrayList(vpmAnalyzerService.getAvailableAnalyzers());

    availableAnalyzer.removeAll(page.getAnalyzers());


    ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new VPMAnalyzerLabelProvider());
    dialog.setTitle("VPM Analyzer Selection");
    dialog.setMessage("Select an analyzer by name (* = any string, ? = any char):");
    dialog.setElements(availableAnalyzer.toArray());
    dialog.setMultipleSelection(false);
    int result = dialog.open();
    if (result == Window.OK) {
        Object analyzerObject = dialog.getFirstResult();
        if (analyzerObject != null) {
            VPMAnalyzer analyzer = (VPMAnalyzer) analyzerObject;
            page.addAnalyzer(analyzer);
        }
    }
}
 
開發者ID:kopl,項目名稱:SPLevo,代碼行數:30,代碼來源:VPMAnalyzerSelectionDialogListener.java

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

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

示例12: selectElement

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			SimpleBPMN.diagram.part.SimpleBPMNDiagramEditorPlugin
					.getInstance().getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(SimpleBPMN.diagram.part.Messages.SimpleBPMNModelingAssistantProviderMessage);
	dialog.setTitle(SimpleBPMN.diagram.part.Messages.SimpleBPMNModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
開發者ID:bluezio,項目名稱:simplified-bpmn-example,代碼行數:21,代碼來源:SimpleBPMNModelingAssistantProvider.java

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

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

import org.eclipse.ui.dialogs.ElementListSelectionDialog; //導入方法依賴的package包/類
/**
 * COPIED/MODIFIED from AntLaunchShortcut
 */
protected 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("Pick a Python configuration");
    dialog.setMessage("Choose a python configuration to run");
    dialog.setMultipleSelection(false);
    int result = dialog.open();
    labelProvider.dispose();
    if (result == Window.OK) {
        return (ILaunchConfiguration) dialog.getFirstResult();
    } else {
        return null;
    }
}
 
開發者ID:fabioz,項目名稱:Pydev,代碼行數:23,代碼來源:AbstractLaunchShortcut.java


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