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


Java MessageDialog类代码示例

本文整理汇总了Java中org.eclipse.jface.dialogs.MessageDialog的典型用法代码示例。如果您正苦于以下问题:Java MessageDialog类的具体用法?Java MessageDialog怎么用?Java MessageDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: isUsernamePasswordOrHostEmpty

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
private boolean isUsernamePasswordOrHostEmpty() {
	Notification notification = new Notification();
	if (remoteMode) {
		if (StringUtils.isEmpty(txtEdgeNode.getText())){
			notification.addError(Messages.EMPTY_HOST_FIELD_MESSAGE);
		}
			
		if (StringUtils.isEmpty(txtUserName.getText())){
			notification.addError(Messages.EMPTY_USERNAME_FIELD_MESSAGE);
		}
		if(radioPassword.getSelection() && StringUtils.isEmpty(txtPassword.getText())){
			notification.addError(Messages.EMPTY_PASSWORD_FIELD_MESSAGE);
		}
	}
	
	if(notification.hasErrors()){
		MessageDialog.openError(Display.getDefault().getActiveShell(), Messages.EMPTY_FIELDS_MESSAGE_BOX_TITLE,
				notification.errorMessage());	
		return true;
	}else{
		return false;
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:24,代码来源:RunConfigDialog.java

示例2: create

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
public static boolean create ( final ViewContext context, final Shell shell )
{
    if ( !context.isWriteDialogRequired () )
    {
        return true;
    }

    if ( SessionManager.getDefault ().hasRole ( suppressConfirmDialogRole ) )
    {
        return true;
    }
    if ( shell == null )
    {
        return MessageDialog.openQuestion ( org.eclipse.scada.vi.details.swt.Activator.getDefault ().getWorkbench ().getActiveWorkbenchWindow ().getShell (), Messages.WriteConfirmDialog_sendData, Messages.WriteConfirmDialog_confirmOperation );
    }
    else
    {
        return MessageDialog.openQuestion ( shell, Messages.WriteConfirmDialog_sendData, Messages.WriteConfirmDialog_confirmOperation );
    }

}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:WriteConfirmDialog.java

示例3: execute

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
  ISelection sel = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow()
      .getSelectionService().getSelection();
  if (sel instanceof ITreeSelection) {
    ITreeSelection treeSel = (ITreeSelection) sel;
    if (treeSel.getFirstElement() instanceof IFile) {
      IFile file = (IFile) treeSel.getFirstElement();
      List<IMarker> markers = MarkerFactory.findMarkers(file);
      MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Marker Count", null,
          markers.size() + " marker(s)", MessageDialog.INFORMATION, new String[] {"OK"}, 0);
      dialog.open();
    }
  }
  return null;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:17,代码来源:CountMarkersInFileHandler.java

示例4: performRelaunch

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
/**
 * Invoked when user performs {@link #actionRelaunch}.
 */
protected void performRelaunch() {
	if (null != currentRoot) {
		final TestSession session = from(registeredSessions).firstMatch(s -> s.root == currentRoot).orNull();
		if (null != session) {
			final TestConfiguration configurationToReRun = session.configuration;
			registeredSessions.remove(session);
			try {
				final TestConfiguration newConfiguration = testerFrontEnd.createConfiguration(configurationToReRun);
				testerFrontEndUI.runInUI(newConfiguration);
			} catch (Exception e) {
				String message = "Test class not found in the workspace.";
				if (!Strings.isNullOrEmpty(e.getMessage())) {
					message += " Reason: " + e.getMessage();
				}
				MessageDialog.openError(getShell(), "Cannot open editor", message);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:23,代码来源:TestResultsView.java

示例5: canAddSubjobToCanvas

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
/**
 * Checks if given subjob can be added to canvas.
 * 
 * @param ioSubjobComponentName
 *            the io subjob component name
 * @return true, if successful
 */
private boolean canAddSubjobToCanvas(String ioSubjobComponentName) {

	if (StringUtils.equalsIgnoreCase(Constants.INPUT_SUBJOB_COMPONENT_NAME, ioSubjobComponentName)
			|| StringUtils.equalsIgnoreCase(Constants.OUTPUT_SUBJOB, ioSubjobComponentName)) {
		for (Component component : components) {
			if (StringUtils.equalsIgnoreCase(ioSubjobComponentName, component.getComponentName())) {
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", ioSubjobComponentName
						+ " [" + component.getComponentLabel().getLabelContents() + "]"
						+ Constants.SUBJOB_ALREADY_PRESENT_IN_CANVAS);
				return false;
			}
		}
	}
	return true;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:Container.java

示例6: pickDevice

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
private IDevice pickDevice() {
  List<IDevice> devices = DebugBridge.getDevices();
  if (devices.size() == 0) {
    MessageDialog.openError(mViewer.getShell(),
        "Error obtaining Device Screenshot",
        "No Android devices were detected by adb.");
    return null;
  } else if (devices.size() == 1) {
    return devices.get(0);
  } else {
    DevicePickerDialog dlg = new DevicePickerDialog(mViewer.getShell(), devices);
    if (dlg.open() != Window.OK) {
      return null;
    }
    return dlg.getSelectedDevice();
  }
}
 
开发者ID:DroidTesting,项目名称:android-uiautomatorviewer,代码行数:18,代码来源:ScreenshotAction.java

示例7: run

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
/**
 * @see IActionDelegate#run(IAction)
 */
public void run(IAction action) {
	if (selection != null) {
		IFile selectedFile = (IFile) ((IStructuredSelection) selection)
				.getFirstElement();

		// Use a platform:/resource/ URI
		URI uri = URI.createPlatformResourceURI(selectedFile.getFullPath().toString(), true);

		ResourceSet rs = new ResourceSetImpl();
		Resource r = rs.getResource(uri, true);

		Extension extension = (Extension) r.getContents().get(0);
		OcciRegistry.getInstance().registerExtension(extension.getScheme(),
				uri.toString());
		closeOtherSessions(selectedFile.getProject());
		MessageDialog.openInformation(shell,
				Messages.RegisterExtensionAction_ExtRegistration,
				Messages.RegisterExtensionAction_RegisteredExtension
						+ extension.getScheme());
	}
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:25,代码来源:RegisterOCCIExtensionAction.java

示例8: exportTextFile

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
protected void exportTextFile() {
	boolean done = false;
	while (!done)
		if (!textEditor.isDisposed()) {
			FileDialog fd = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE);
			fd.setFilterNames(new String[] { "Plain text file (*.txt)", "All Files (*.*)" });
			fd.setFilterExtensions(new String[] { "*.txt", "*.*" });
			String lastPath = Config.getInstance().getString(Config.LAST_EXPORT_TRANSCRIPTION_PATH);
			if (lastPath != null && !lastPath.isEmpty())
				fd.setFileName(lastPath);
			String file = fd.open();
			try {
				if (file != null) {
					Config.getInstance().putValue(Config.LAST_EXPORT_TRANSCRIPTION_PATH, file);
					File destFile = new File(file);
					boolean overwrite = true;
					if (destFile.exists())
						overwrite = MessageDialog.openConfirm(shell, "Overwrite current file?",
								"Would you like to overwrite " + destFile.getName() + "?");
					if (overwrite) {
						textEditor.exportText(new File(file));
						done = true;
					}
				} else
					done = true;
			} catch (Exception e) {
				e.printStackTrace();
				MessageBox diag = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
				diag.setMessage("Unable to export to file " + transcriptionFile.getPath());
				diag.open();
			}
		}
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:34,代码来源:PmTrans.java

示例9: exportOperation

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
/**
 * Exports UI-operation data to external file
 * 
 * @param file
 * @param mappingSheetRow
 * @param showErrorMessage
 * @param list
 * @throws ExternalTransformException
 */
public void exportOperation(File file, MappingSheetRow mappingSheetRow ,boolean showErrorMessage,List<GridRow> list) throws ExternalTransformException {
	if (file!=null) {
		try{
			Object object=convertUIOperationToJaxb(mappingSheetRow, list);
			marshal(ExternalOperations.class, file, object);
		} catch (Exception exception) {
			LOGGER.warn("Error ", exception);
			if(showErrorMessage){
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to export output fields - \n"+exception.getMessage());
			}
			return;
		}
		MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Operation exported sucessfully");
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:25,代码来源:ExternalOperationExpressionUtil.java

示例10: execute

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
  ISelection selection = MarkerFactory.getSelection();
  if (selection instanceof ITreeSelection) {
    ITreeSelection treeSelection = (ITreeSelection) selection;
    if (treeSelection.getFirstElement() instanceof IOpenable
        || treeSelection.getFirstElement() instanceof IFile) {
      IResource resource =
          ((IAdaptable) treeSelection.getFirstElement()).getAdapter(IResource.class);
      List<IMarker> markers = MarkerFactory.findMarkers(resource);
      MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Marker Count", null,
          markers.size() + " marker(s)", MessageDialog.INFORMATION, new String[] {"OK"}, 0);
      dialog.open();
    }
  }
  return null;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:18,代码来源:CountMarkersInResourceHandler.java

示例11: compareSchemaFields

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
/** 
 * @param inputLinkSchema
 * @param currentCompSchema
 */
private boolean compareSchemaFields(List<GridRow> inputLinkSchema, List<GridRow> currentCompSchema){
	for(int index = 0; index < currentCompSchema.size() - 1; index++){
		for(GridRow gridRow : inputLinkSchema){
			if(StringUtils.equals(gridRow.getFieldName(), currentCompSchema.get(index).getFieldName())){
				if(!StringUtils.equals(gridRow.getDataTypeValue(), currentCompSchema.get(index).getDataTypeValue())){
					MessageDialog dialog = new MessageDialog(new Shell(),
							"Warning", null,"Output Schema is updated,Do you want to continue with changes?", MessageDialog.CONFIRM,
							new String[] {"Yes", "No"}, 0);
					int dialogResult =dialog.open();
					if(dialogResult == 0){
						return true;
					}else{
						return false;
					}
				}
			}
		}
	}
	return true;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:25,代码来源:TransformWidget.java

示例12: generateTargetXMLInWorkspace

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
private void generateTargetXMLInWorkspace(IFile ifile, Container container) {
	IFile outPutFile = ResourcesPlugin.getWorkspace().getRoot().getFile(ifile.getFullPath().removeFileExtension().addFileExtension("xml"));
	try {
		if(container!=null)
			ConverterUtil.INSTANCE.convertToXML(container, false, outPutFile,null);
		else
			ConverterUtil.INSTANCE.convertToXML(this.container, false, outPutFile,null);
	} catch (EngineException eexception) {
		logger.warn("Failed to create the engine xml", eexception);
		MessageDialog.openError(Display.getDefault().getActiveShell(), "Failed to create the engine xml", eexception.getMessage());
		//			
	}catch (InstantiationException|IllegalAccessException| InvocationTargetException| NoSuchMethodException exception) {
		logger.error("Failed to create the engine xml", exception);
		Status status = new Status(IStatus.ERROR, "hydrograph.ui.graph",
				"Failed to create Engine XML " + exception.getMessage());
		StatusManager.getManager().handle(status, StatusManager.SHOW);
	}
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:ELTGraphicalEditor.java

示例13: importExpression

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
public ExpressionData importExpression(File file, ExpressionData expressionData,boolean showErrorMessage,
	 String componentName) {
	
	if (file!=null) {
		try (FileInputStream fileInputStream=new FileInputStream(file)){
			ExternalExpressions externalExpression = (ExternalExpressions) ExternalOperationExpressionUtil.INSTANCE.unmarshal(fileInputStream,ExternalExpressions.class);
			
			expressionData = convertToUIExpression(externalExpression.getExternalExpressions(),expressionData, componentName);
			if(showErrorMessage && expressionData!=null){
				MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Expression imported sucessfully");
			}
		} catch (Exception exception) {
			LOGGER.warn("Error ", exception);
			if(showErrorMessage){
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to import expression - Invalid XML");
			}
		}
	}
	return expressionData;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:FilterLogicExternalOperationExpressionUtil.java

示例14: run

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
@Override
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
	MessageDialog.openInformation(
		shell,
		"Convertigo Plug-in",
		"The choosen operation is not yet implemented : '"+ action.getId() + "'.");
	
	shell.setCursor(null);
	waitCursor.dispose();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:17,代码来源:MyAbstractAction.java

示例15: removeNode

import org.eclipse.jface.dialogs.MessageDialog; //导入依赖的package包/类
private void removeNode() {
	final INamedNode selectedNode = getSelection();
	ControlTree controlTree = getControlTree();
	INamedNode parent = controlTree.getNode(selectedNode.getParentName());
	if (selectedNode.getChildren()==null || selectedNode.getChildren().length<1) {
		controlTree.delete(selectedNode);
	} else {
		boolean ok = MessageDialog.openQuestion(content.getShell(), "Confirm Delete", "The item '"+selectedNode.getName()+"' is a group.\n\nAre you sure you would like to delete it?");
		if (ok) controlTree.delete(selectedNode);
	}
	viewer.refresh();
	if (parent.hasChildren()) {
		setSelection(parent.getChildren()[parent.getChildren().length-1]);
	} else {
	    setSelection(parent);
	}
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:18,代码来源:ControlTreeViewer.java


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