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


Java MessageBox.setText方法代码示例

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


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

示例1: runWithObject

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
@Override
public void runWithObject(Object object) throws Exception {
    String typeName = getObjectTypeName(object);
    if (typeName == null) {
        return;
    }

    String name = getObjectName(object);
    if (name == null) {
        return;
    }

    MessageBox messageBox = new MessageBox(getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
    messageBox.setMessage("Are you sure you want to delete the " + typeName + " '" + name + "'?");
    messageBox.setText("Confirm Delete");
    int response = messageBox.open();
    if (response == SWT.YES) {
        try {
            delete(object);
        }
        catch (Exception e) {
            throw new Exception("Failed to delete the " + typeName + " '" + name + "'.", e);
        }
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:26,代码来源:BaseDeleteAction.java

示例2: populateViewParameterFileBox

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
private void populateViewParameterFileBox(ParameterFile parameterFile) {
	//parameterFileTextBox.setText(file.getPath());
	try {
		Map<String, String> parameterMap = new LinkedHashMap<>();
		parameterMap = ParameterFileManager.getInstance().getParameterMap(getParamterFileLocation(parameterFile));
		setGridData(parameters, parameterMap);
		parameterTableViewer.setData("CURRENT_PARAM_FILE", getParamterFileLocation(parameterFile));
	} catch (IOException ioException) {

		MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_ERROR
				| SWT.OK);

		messageBox.setText(MessageType.ERROR.messageType());
		messageBox.setMessage(ErrorMessages.UNABLE_TO_POPULATE_PARAM_FILE
				+ ioException.getMessage());
		messageBox.open();

		logger.debug("Unable to populate parameter file", ioException);

	}

	parameterTableViewer.refresh();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:24,代码来源:MultiParameterFileDialog.java

示例3: validateXML

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
private boolean validateXML(InputStream xml, InputStream xsd){
 try
 {
	 SchemaFactory factory = 
			 SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
	 javax.xml.validation.Schema schema = factory.newSchema(new StreamSource(xsd));
	 Validator validator = schema.newValidator();

	 validator.validate(new StreamSource(xml));
	 return true;
 }
 catch( SAXException| IOException ex)
 {
	 //MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", Messages.IMPORT_XML_FORMAT_ERROR + "-\n" + ex.getMessage());
	 MessageBox dialog = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_ERROR | SWT.OK);
	 dialog.setText(Messages.ERROR);
	 dialog.setMessage(Messages.IMPORT_XML_FORMAT_ERROR + "-\n" + ex.getMessage());
	 logger.error(Messages.IMPORT_XML_FORMAT_ERROR);
	 return false;
 }
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:ELTSchemaGridWidget.java

示例4: loadSchemaFromExternalFile

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
/**
**
 * This methods loads schema from external schema file
 * 
 * @param externalSchemaFilePath
 * @param schemaType
 * @return
 */
public List<GridRow> loadSchemaFromExternalFile(String externalSchemaFilePath,String schemaType) {
	IPath filePath=new Path(externalSchemaFilePath);
	IPath copyOfFilePath=filePath;
	if (!filePath.isAbsolute()) {
		filePath = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath).getRawLocation();
	}
	if(filePath!=null && filePath.toFile().exists()){
	GridRowLoader gridRowLoader=new GridRowLoader(schemaType, filePath.toFile());
	return gridRowLoader.importGridRowsFromXML();
	
	}else{
		MessageBox messageBox=new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_ERROR);
		messageBox.setMessage(Messages.FAILED_TO_IMPORT_SCHEMA_FILE+"\n"+copyOfFilePath.toString());
		messageBox.setText(Messages.ERROR);
		messageBox.open();
	}
	return null;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:27,代码来源:ConverterUiHelper.java

示例5: cancelPressed

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
@Override
protected void cancelPressed() {
	if (isAnyUpdatePerformed) {
		int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO |SWT.ICON_INFORMATION;
		MessageBox messageBox = new MessageBox(new Shell(), style);
		messageBox.setText(INFORMATION);
		messageBox.setMessage(Messages.MessageBeforeClosingWindow);

		if (messageBox.open() == SWT.YES) {
			closeDialog = super.close();
		}
	} else {
		closeDialog = super.close();
	}

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:17,代码来源:SecondaryColumnKeysDialog.java

示例6: createMessageBox

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
/**
 * create SWT MessageBox
 * 
 * @param message to be shown 
 * @param title of widow
 * @param style to be set on window           
 */

public static int createMessageBox(String message,String windowTitle,int style) {
	Shell shell = new Shell();
	MessageBox messageBox = new MessageBox(shell,style);
	messageBox.setText(windowTitle);
	messageBox.setMessage(message);
	return messageBox.open();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:16,代码来源:WidgetUtility.java

示例7: errorMessage

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
/**
 * Error message.
 * 
 * @param message
 *            the message
 */
public static void errorMessage(String message) {
	Shell shell = new Shell();
	MessageBox messageBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
	messageBox.setText(ERROR);
	messageBox.setMessage(message);
	messageBox.open();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:WidgetUtility.java

示例8: showMessage

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
/**
 * 
 * Show message box with ok button
 * 
 * @param messageBoxTitle - Message box title
 * @param message - Message to be displayed 
 */
public void showMessage(String messageBoxTitle, String message) {
	int shellStyle= SWT.APPLICATION_MODAL | SWT.OK | getMessageBoxIcon(messageBoxTitle);
	MessageBox messageBox = new MessageBox(new Shell(),shellStyle);
	messageBox.setText(messageBoxTitle);
	messageBox.setMessage(message);
	messageBox.open();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:15,代码来源:Utils.java

示例9: isDummyComponentAvailable

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
private boolean isDummyComponentAvailable() {
	ELTGraphicalEditor editor = SubJobUtility.getCurrentEditor();
	Container container=editor.getContainer();
	for(Component component:container.getUIComponentList()){
		if(StringUtils.equals(component.getComponentName(), "UnknownComponent")){
			MessageBox messageBox=new MessageBox(Display.getCurrent().getActiveShell(),SWT.ICON_WARNING);
			messageBox.setMessage("Cannot run job with Dummy Component");
			messageBox.setText("Warning");
			messageBox.open();
			return true;
		}
	}
	return false;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:15,代码来源:JobHandler.java

示例10: showErrorMessage

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
private int showErrorMessage(IFile xmlFile,String message) {
	MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(),
			SWT.ERROR | SWT.YES | SWT.NO);
	messageBox.setText(ERROR);
	messageBox.setMessage(message);
	int returnCode = messageBox.open();
	return returnCode;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:9,代码来源:PasteHandler.java

示例11: getListener

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
		Widget... widgets) {
	final Widget[] widgetList = widgets;

	Listener listener = new Listener() {
		@Override
		public void handleEvent(Event event) {
			String comboValue = ((Combo) widgetList[0]).getText();
			propertyDialogButtonBar.enableApplyButton(true);
			if (Messages.CUSTOM.equalsIgnoreCase(comboValue) && !FilterOperationClassUtility.INSTANCE.isCheckBoxSelected()) {
				((Text) widgetList[1]).setText("");
				((Text) widgetList[1]).setEnabled(true);
				FilterOperationClassUtility.INSTANCE.enableAndDisableButtons(true, false);
			} else {
				if(FilterOperationClassUtility.INSTANCE.isCheckBoxSelected())
				{
					MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_ERROR | SWT.OK);
					messageBox.setText(Messages.ERROR);
					messageBox.setMessage(Messages.CHECKBOX_DISABLE_MESSAGE);
					if (messageBox.open() == SWT.OK) {
						((Combo) widgetList[0]).setText(Messages.CUSTOM);
					} 
				}
				else
				{
					FilterOperationClassUtility.INSTANCE.setOperationClassNameInTextBox(comboValue, (Text)widgetList[1]);
					((Text) widgetList[1]).setEnabled(false);
					FilterOperationClassUtility.INSTANCE.enableAndDisableButtons(false, false);
					((Button) widgetList[2]).setEnabled(false);
				}
			}
		} 
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:37,代码来源:OperationClassComboChangeListener.java

示例12: updateParameterGridWindow

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
private void updateParameterGridWindow(String[] listOfFilesToBeImported, String importLocation,ParamterFileTypes paramterFileTypes) {
	for (String fileName : listOfFilesToBeImported) {
		if (fileName != null) {
			String absoluteFileName = importLocation + fileName;
			parameterFileTextBox.setText(absoluteFileName);
			parameterFiles.add(new ParameterFile(fileName, paramterFileTypes));
			if(paramterFileTypes.equals(ParamterFileTypes.JOB_LEVEL)){
				jobLevelParamterFiles.add(new ParameterFile(fileName, paramterFileTypes));
			}
			try {
				parameterTableViewer.setData(MultiParameterFileDialogConstants.CURRENT_PARAM_FILE,
						absoluteFileName);
				Map<String, String> parameterMap = new LinkedHashMap<>();
				parameterMap = ParameterFileManager.getInstance().getParameterMap(absoluteFileName);
				setGridData(parameters, parameterMap);
			} catch (IOException ioException) {
				MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_ERROR | SWT.OK);
				messageBox.setText(MessageType.ERROR.messageType());
				messageBox.setMessage(ErrorMessages.UNABLE_TO_POPULATE_PARAM_FILE
						+ ioException.getMessage());
				messageBox.open();
				logger.debug("Unable to populate parameter file", ioException.getMessage());
			}
			filePathTableViewer.refresh();
			parameterTableViewer.refresh();
			populateParameterSearchBox();
		}
	}
	if(paramterFileTypes.equals(ParamterFileTypes.JOB_LEVEL)){
		getComponentCanvas().addJobLevelParamterFiles(jobLevelParamterFiles);
	}
	parameterFileTextBox.setText("");
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:34,代码来源:MultiParameterFileDialog.java

示例13: showUnrecognizedDiskFormatMessage

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
/**
 * Displays the unrecognized disk format message.
 * @param fullpath
 */
protected void showUnrecognizedDiskFormatMessage(String fullpath) {
	Shell finalShell = shell;
	MessageBox box = new MessageBox(finalShell, SWT.ICON_ERROR | SWT.OK);
	box.setText(textBundle.get("SwtAppleCommander.UnrecognizedFormatTitle")); //$NON-NLS-1$
	box.setMessage(
		  textBundle.format("SwtAppleCommander.UnrecognizedFormatMessage", //$NON-NLS-1$
		  		fullpath));
	box.open();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:14,代码来源:SwtAppleCommander.java

示例14: ok

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
private void ok() {
  if ( Const.isEmpty( wName.getText() ) ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setText( BaseMessages.getString( PKG, "System.StepJobEntryNameMissing.Title" ) );
    mb.setMessage( BaseMessages.getString( PKG, "System.JobEntryNameMissing.Msg" ) );
    mb.open();
    return;
  }
  jobEntry.setName( wName.getText() );
  jobEntry.setConfigInfo( wConfigInfo.getText() );
  jobEntry.setClassName( wClassName.getText() );
  dispose();
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:14,代码来源:JobEntryEasyExpandDialog.java

示例15: isFileExistsOnLocalFileSystem

import org.eclipse.swt.widgets.MessageBox; //导入方法依赖的package包/类
/**
 * Check if file exist on local file system. 
 * @param jobFilePath
 * @param textBox
 * @return
 */
private boolean isFileExistsOnLocalFileSystem(IPath jobFilePath, Text textBox) {
	jobFilePath=jobFilePath.removeFileExtension().addFileExtension(Constants.XML_EXTENSION_FOR_IPATH);
	try {
		if (ResourcesPlugin.getWorkspace().getRoot().getFile(jobFilePath).exists()){
			return true;
		}
		else if (jobFilePath.toFile().exists()){
			return true;
		}
	} catch (Exception exception) {
		logger.error("Error occured while cheking file on local file system", exception);
	}
	MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_WARNING | SWT.YES
			| SWT.NO);
	messageBox.setMessage(jobFilePath.lastSegment()+Messages.FILE_DOES_NOT_EXISTS);
	messageBox.setText(jobFilePath.toString() +Messages.NOT_EXISTS);
	int response = messageBox.open();
	if (response == SWT.YES) {
		jobFilePath=jobFilePath.removeFileExtension().addFileExtension(Constants.JOB_EXTENSION_FOR_IPATH);
		textBox.setText(jobFilePath.toString().substring(1));
	}
	else{
		textBox.setText("");
	}
	return false;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:33,代码来源:FilterOperationClassUtility.java


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