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


Java ListDialog.setMessage方法代码示例

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


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

示例1: openDialog

import org.eclipse.ui.dialogs.ListDialog; //导入方法依赖的package包/类
private ICoverageLaunch openDialog(ExecutionEvent event,
    List<ICoverageLaunch> launches) {
  final ListDialog dialog = new ListDialog(HandlerUtil.getActiveShell(event)) {
    @Override
    protected void configureShell(Shell shell) {
      super.configureShell(shell);
      ContextHelp.setHelp(shell, ContextHelp.DUMP_EXECUTION_DATA);
    }
  };
  dialog.setTitle(UIMessages.DumpExecutionDataDialog_title);
  dialog.setMessage(UIMessages.DumpExecutionDataDialog_message);
  dialog.setContentProvider(ArrayContentProvider.getInstance());
  dialog.setLabelProvider(new LaunchLabelProvider());
  dialog.setInput(launches);
  if (dialog.open() == Dialog.OK && dialog.getResult().length == 1) {
    return (ICoverageLaunch) dialog.getResult()[0];
  }
  return null;
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:20,代码来源:DumpExecutionDataHandler.java

示例2: createQueryRunnable

import org.eclipse.ui.dialogs.ListDialog; //导入方法依赖的package包/类
private Runnable createQueryRunnable(final String question, final Object[] elements, final int[] result) {
	return new Runnable() {
		public void run() {
			ListDialog dialog= new YesNoListDialog(fShell, true);
			dialog.setAddCancelButton(false);
			dialog.setBlockOnOpen(true);
			dialog.setContentProvider(new ArrayContentProvider());
			dialog.setLabelProvider(new JavaElementLabelProvider());
			dialog.setTitle(fDialogTitle);
			dialog.setMessage(question);
			dialog.setInput(elements);

			dialog.open();
			result[0]= dialog.getReturnCode();
		}
	};
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:ReorgQueries.java

示例3: showSaveDirtyFileDialog

import org.eclipse.ui.dialogs.ListDialog; //导入方法依赖的package包/类
private static boolean showSaveDirtyFileDialog(
		List<IEditorPart> dirtyEditors )
{
	AdaptableList input = new AdaptableList( dirtyEditors );

	ListDialog dlg = new ListDialog( PlatformUI.getWorkbench( )
			.getActiveWorkbenchWindow( )
			.getShell( ) );
	dlg.setContentProvider( new BaseWorkbenchContentProvider( ) );
	dlg.setLabelProvider( new WorkbenchPartLabelProvider( ) );
	dlg.setInput( input );
	dlg.setMessage( Messages.getString( "renameChecker.saveResourcesMessage" ) ); //$NON-NLS-1$
	dlg.setTitle( Messages.getString( "renameChecker.saveResourcesTitle" ) ); //$NON-NLS-1$

	// Just return false to prevent the operation continuing
	return dlg.open( ) == IDialogConstants.OK_ID;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:ResourceCloseManagement.java

示例4: widgetSelected

import org.eclipse.ui.dialogs.ListDialog; //导入方法依赖的package包/类
@Override
public void widgetSelected(SelectionEvent e) {
	ListDialog dialog = new ListDialog(getShell());
	WorkbenchContentProvider contentProvider = new WorkbenchContentProvider();
	dialog.setContentProvider(contentProvider);
	dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
	dialog.setLabelProvider(new WorkbenchLabelProvider());
	dialog.setTitle("Select Project");
	dialog.setMessage("Select Project:");
	if (dialog.open() == Window.OK && dialog.getResult().length == 1) {
		IProject selectedProject = (IProject) dialog.getResult()[0];
		project.setText(selectedProject.getName());
	}
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:15,代码来源:BfMainTab.java

示例5: askSaveAllDirtyEditors

import org.eclipse.ui.dialogs.ListDialog; //导入方法依赖的package包/类
private boolean askSaveAllDirtyEditors(Shell shell, IEditorPart[] dirtyEditors) {
	final boolean canSaveAutomatically= fSaveMode != SAVE_ALL_ALWAYS_ASK;
	if (canSaveAutomatically && RefactoringSavePreferences.getSaveAllEditors()) //must save everything
		return true;
	ListDialog dialog= new ListDialog(shell) {
		{
			setShellStyle(getShellStyle() | SWT.APPLICATION_MODAL);
		}
		@Override
		protected Control createDialogArea(Composite parent) {
			Composite result= (Composite) super.createDialogArea(parent);
			if (canSaveAutomatically) {
				final Button check= new Button(result, SWT.CHECK);
				check.setText(RefactoringMessages.RefactoringStarter_always_save);
				check.setSelection(RefactoringSavePreferences.getSaveAllEditors());
				check.addSelectionListener(new SelectionAdapter() {
					@Override
					public void widgetSelected(SelectionEvent e) {
						RefactoringSavePreferences.setSaveAllEditors(check.getSelection());
					}
				});
				applyDialogFont(result);
			}
			return result;
		}
	};
	dialog.setTitle(RefactoringMessages.RefactoringStarter_save_all_resources);
	dialog.setAddCancelButton(true);
	dialog.setLabelProvider(createDialogLabelProvider());
	dialog.setMessage(RefactoringMessages.RefactoringStarter_must_save);
	dialog.setContentProvider(new ArrayContentProvider());
	dialog.setInput(Arrays.asList(dirtyEditors));
	return dialog.open() == Window.OK;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:35,代码来源:RefactoringSaveHelper.java

示例6: askSaveAllDirtyEditors

import org.eclipse.ui.dialogs.ListDialog; //导入方法依赖的package包/类
private boolean askSaveAllDirtyEditors(Shell shell, IEditorPart[] dirtyEditors) {
	final boolean canSaveAutomatically= fSaveMode != SAVE_ALL_ALWAYS_ASK;
	if (canSaveAutomatically && RefactoringSavePreferences.getSaveAllEditors()) //must save everything
		return true;
	ListDialog dialog= new ListDialog(shell) {
		{
			setShellStyle(getShellStyle() | SWT.APPLICATION_MODAL);
		}
		@Override
		protected Control createDialogArea(Composite parent) {
			Composite result= (Composite) super.createDialogArea(parent);
			if (canSaveAutomatically) {
				final Button check= new Button(result, SWT.CHECK);
				check.setText(RefactoringMessages.RefactoringStarter_always_save);
				check.setSelection(RefactoringSavePreferences.getSaveAllEditors());
				check.addSelectionListener(new SelectionAdapter() {
					@Override
					public void widgetSelected(SelectionEvent e) {
						RefactoringSavePreferences.setSaveAllEditors(check.getSelection());
					}
				});
				applyDialogFont(result);
			}
			return result;
		}
	};
	dialog.setTitle(RefactoringMessages.RefactoringStarter_save_all_resources);
	dialog.setLabelProvider(createDialogLabelProvider());
	dialog.setMessage(RefactoringMessages.RefactoringStarter_must_save);
	dialog.setContentProvider(new ArrayContentProvider());
	dialog.setInput(Arrays.asList(dirtyEditors));
	return dialog.open() == Window.OK;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:34,代码来源:RefactoringSaveHelper.java

示例7: openProjectSettings

import org.eclipse.ui.dialogs.ListDialog; //导入方法依赖的package包/类
void openProjectSettings() {
	ListDialog dialog = new ListDialog(getShell()) {

		protected Control createDialogArea(Composite container) {
			Control area = super.createDialogArea(container);
			getTableViewer().setSorter(new ResourceSorter(ResourceSorter.NAME));
			return area;
		}
	};
	dialog.setMessage(SSEUIMessages.PropertyPreferencePage_02);
	dialog.setContentProvider(new IStructuredContentProvider() {
		public void dispose() {
		}

		public Object[] getElements(Object inputElement) {
			return ((IWorkspace) inputElement).getRoot().getProjects();
		}

		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
		}
	});
	dialog.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(), SSEUIPlugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
	dialog.setInput(ResourcesPlugin.getWorkspace());
	dialog.setTitle(SSEUIMessages.PropertyPreferencePage_01);
	if (dialog.open() == Window.OK) {
		Object[] result = dialog.getResult();
		if (result.length > 0) {
			IProject project = (IProject) dialog.getResult()[0];
			Map data = new HashMap();
			data.put(DISABLE_LINK, Boolean.TRUE);
			PreferencesUtil.createPropertyDialogOn(getShell(), project, getPropertyPageID(), new String[]{getPropertyPageID()}, data).open();
		}
	}
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-webresources,代码行数:35,代码来源:PropertyPreferencePage.java

示例8: selectAttachment

import org.eclipse.ui.dialogs.ListDialog; //导入方法依赖的package包/类
/**
 * Selects the attachment.
 * 
 * @param parent
 *            the parent shell.
 * @param currentAttachment
 *            the original attachment.
 * @param basicNode
 *            the node.
 * @return the selected attachment.
 * 
 * @see net.dependableos.dcase.diagram.ui.AttributeDialog.IAttachmentSelector#selectAttachment(java.lang.String)
 */
public String selectAttachment(Shell parent, String currentAttachment,
		BasicNode basicNode) {
	if (basicNode instanceof Goal || basicNode instanceof Userdef005 ||
			basicNode instanceof Userdef001) {
		ListDialog dialog = new ListDialog(parent);
		dialog.setTitle("Select from Modules..."); //$NON-NLS-1$
		dialog.setMessage("Select from the following Modules..."); //$NON-NLS-1$
		dialog.setContentProvider(new ArrayContentProvider());
		dialog.setLabelProvider(new LabelProvider());

		// get data
		argumentEditPart = DcaseEditorUtil.getCurrentArgumentEditPart();
		boolean isGoalNode = (basicNode instanceof Goal);
		ArrayList<String> data = new ArrayList<String>();
		Map<String, String> map = null;
		try {
			map = ModuleUtil.getModulesAndNodes(argumentEditPart,
					isGoalNode);
		} catch (CoreException e) {
			MessageWriter.writeMessageToConsole(
					Messages.SelectModuleContributionItem_0,
					MessageTypeImpl.SELECT_MODULE_FAILED);
			return null;
		}
		IFile modelFile = DcaseEditorUtil.getModelFile(argumentEditPart);
		String moduleName = ModuleUtil.getModuleName(modelFile);
		for (Map.Entry<String, String> entry : map.entrySet()) {
			String name = entry.getKey();
			if (moduleName.equals(ModuleUtil.getModuleName(name))) {
				continue;
			}
			if (isGoalNode && !ModuleUtil.isPublicNodeName(name)) {
				continue;
			}
			data.add(name);
		}
		dialog.setInput(data.toArray());

		if (dialog.open() == ListDialog.OK) {
			Object[] result = dialog.getResult();
			if (result.length == 1) {
				return (String) result[0];
			}
		}
	}

	return null;
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:62,代码来源:SelectModuleContributionItem.java


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