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


Java SWT.OK属性代码示例

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


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

示例1: validateLengthOfJobName

/**
 * 
 * Validates length of job name
 * 
 * @param {@link SaveAsDialog}
 */
public void validateLengthOfJobName(SaveAsDialog saveAsDialog) {
	String jobName=saveAsDialog.getResult().removeFileExtension().lastSegment();
	while(jobName.length()>50)
	{
		jobName=saveAsDialog.getResult().removeFileExtension().lastSegment();
		if(jobName.length()>50)
		{
			MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_ERROR | SWT.OK);
			messageBox.setText("Error");
			messageBox.setMessage("File Name Too Long");
			if(messageBox.open()==SWT.OK)
			{
				saveAsDialog.setOriginalName(jobName+".job");
				IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(saveAsDialog.getResult());
				saveAsDialog.setOriginalFile(file);
				saveAsDialog.open();
				if(saveAsDialog.getReturnCode()==1)
					break;
			}
		}
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:28,代码来源:ELTGraphicalEditor.java

示例2: toolSelected

@Override
public void toolSelected() {
	Sketch sketch = AvoGlobal.project.getActiveSketch();
	if(sketch == null || sketch.isConsumed){
		MessageBox m = new MessageBox(AvoGlobal.menuet.getShell(), SWT.ICON_QUESTION | SWT.OK);
		m.setMessage(	"You must select an unconsumed sketch before\n" +
						"any 2Dto3D operations can be performed.\n\n" +
						"Please create a new sketch or select one\n" +
						"by double-clicking on it in the project's\n" +
						"list of elements.");
		m.setText("Please select a sketch");
		m.open();
	}else{			
		// there is a sketch active!
		
		changeMenuetToolMode(Menuet.MENUET_MODE_BUILD);
		
		// TODO: Building should not be done in the view!!
		sketch.buildRegions();
		
		int i = AvoGlobal.project.getActivePart().addNewFeat2D3D(sketch.getUniqueID());
		AvoGlobal.project.getActivePart().setActiveSubPart(i);
		
	}
}
 
开发者ID:avoCADo-3d,项目名称:avoCADo,代码行数:25,代码来源:ToolPartBuildView.java

示例3: MessageBoxShell

/** Open a messagebox with actual title and text
 *
 * @param parent
 * @param style
 * @param title
 * @param text
 * @return
 */
public MessageBoxShell(int style, String title, String text) {
	if ((style & (0x7f << 5)) == 0) {
		// need at least one button
		style |= SWT.OK;
	}

	final Object[] buttonInfo = swtButtonStylesToText(style);

	this.title = title;
	this.text = text;
	this.buttons = (String[]) buttonInfo[0];
	this.defaultButtonPos = 0;
	this.rememberID = null;
	this.rememberText = null;
	this.rememberByDefault = false;
	this.autoCloseInMS = -1;
	this.buttonVals = (Integer[]) buttonInfo[1];

	setLeftImage(style & 0x1f);
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:28,代码来源:MessageBoxShell.java

示例4: showMessage

/**
 * 
 * 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);
	org.eclipse.swt.widgets.MessageBox messageBox = new org.eclipse.swt.widgets.MessageBox(Display.getDefault().getActiveShell(),shellStyle);
	messageBox.setText(messageBoxTitle);
	messageBox.setMessage(message);
	messageBox.open();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:MessageBox.java

示例5: ok

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,项目名称:KettleUtil,代码行数:13,代码来源:JobEntryEasyExpandDialog.java

示例6: errorMessage

/**
 * 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,代码行数:13,代码来源:WidgetUtility.java

示例7: preferences

public void preferences() {
	try {
		Config.getInstance().showConfigurationDialog(shell);
	} catch (PmTransException e) {
		MessageBox diag = new MessageBox(Display.getCurrent().getActiveShell(),
				SWT.APPLICATION_MODAL | SWT.ICON_ERROR | SWT.OK);
		diag.setMessage("Unable to save preferences");
		diag.open();
	}
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:10,代码来源:PmTrans.java

示例8: cancelPressed

@Override
protected void cancelPressed() {
	if (isAnyUpdatePerformed) {
		int style = SWT.APPLICATION_MODAL | SWT.OK | SWT.CANCEL |SWT.ICON_INFORMATION;
		MessageBox messageBox = new MessageBox(getShell(), style);
		messageBox.setText(Messages.INFORMATION); //$NON-NLS-1$
		messageBox.setMessage(Messages.MessageBeforeClosingWindow);
		if (messageBox.open() == SWT.OK) {
			closeDialog = super.close();
		}
	} else {
		closeDialog = super.close();
	}

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

示例9: saveParameters

private boolean saveParameters() {
	String currentFilePath = (String) parameterTableViewer
			.getData(MultiParameterFileDialogConstants.CURRENT_PARAM_FILE);
	if (!StringUtils.isEmpty(currentFilePath)) {
		
		Map<String, String> parameterMap = new LinkedHashMap<>();
		for (Parameter parameter : parameters) {
			if(StringUtils.isEmpty(parameter.getParameterName())){
				MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_WARNING | SWT.OK | SWT.CANCEL);
				messageBox.setText(ErrorMessages.WARNING);
				messageBox.setMessage(ErrorMessages.BLANK_PARAMETER_WILL_BE_LOST);
				int response = messageBox.open();
				if (response != SWT.OK) {
					return false;
				}
			}else{
			parameterMap.put(parameter.getParameterName(),
					parameter.getParameterValue());
			}
		}
		try {
			ParameterFileManager.getInstance().storeParameters(parameterMap, null, currentFilePath);
			ifNotified = false;
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	}

	populateParameterSearchBox();
	return true;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:31,代码来源:MultiParameterFileDialog.java

示例10: showUnrecognizedDiskFormatMessage

/**
 * 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,代码行数:13,代码来源:SwtAppleCommander.java

示例11: showAboutAppleCommander

public void showAboutAppleCommander() {
	final Shell finalShell = shell;
	MessageBox box = new MessageBox(finalShell, SWT.ICON_INFORMATION | SWT.OK);
	box.setText(textBundle.get("SwtAppleCommander.AboutTitle")); //$NON-NLS-1$
	box.setMessage( 
	  textBundle.format("SwtAppleCommander.AboutMessage", //$NON-NLS-1$
	  new Object[] { AppleCommander.VERSION, textBundle.get("Copyright") })); //$NON-NLS-1$
	box.open();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:9,代码来源:SwtAppleCommander.java

示例12: showErrorDialog

/**
 * Display a dialog box with the error icon and only the ok button.
 */
public static void showErrorDialog(Shell shell, String title, String message) {
	MessageBox messageBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
	messageBox.setText(title);
	messageBox.setMessage(message);
	messageBox.open();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:9,代码来源:SwtUtil.java

示例13: updateParameterGridWindow

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,代码行数:33,代码来源:MultiParameterFileDialog.java

示例14: refreshDifference

void refreshDifference () {
	DeviceData info = display.getDeviceData ();
	if (!info.tracking) {
		MessageBox dialog = new MessageBox (shell, SWT.ICON_WARNING | SWT.OK);
		dialog.setText (shell.getText ());
		dialog.setMessage ("Warning: Device is not tracking resource allocation"); //$NON-NLS-1$
		dialog.open ();
	}
	Object [] newObjects = info.objects;
	Error [] newErrors = info.errors;
	Object [] diffObjects = new Object [newObjects.length];
	Error [] diffErrors = new Error [newErrors.length];
	int count = 0;
	for (int i=0; i<newObjects.length; i++) {
		int index = 0;
		while (index < oldObjects.length) {
			if (newObjects [i] == oldObjects [index]) break;
			index++;
		}
		if (index == oldObjects.length) {
			diffObjects [count] = newObjects [i];
			diffErrors [count] = newErrors [i];
			count++;
		}
	}
	objects = new Object [count];
	errors = new Error [count];
	System.arraycopy (diffObjects, 0, objects, 0, count);
	System.arraycopy (diffErrors, 0, errors, 0, count);
	list.removeAll ();
	text.setText (""); //$NON-NLS-1$
	canvas.redraw ();
	for (int i=0; i<objects.length; i++) {
		list.add (objectName (objects [i]));
	}
	refreshLabel ();
	layout ();
}
 
开发者ID:marvinmalkowskijr,项目名称:applecommander,代码行数:38,代码来源:Sleak.java

示例15: showOkCancelErrorDialog

/**
 * Display a dialog box with the error icon and a ok/cancel button selection.
 */
public static int showOkCancelErrorDialog(Shell shell, String title, String message) {
	MessageBox messageBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK | SWT.CANCEL);
	messageBox.setText(title);
	messageBox.setMessage(message);
	return messageBox.open();
}
 
开发者ID:marvinmalkowskijr,项目名称:applecommander,代码行数:9,代码来源:SwtUtil.java


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