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


Java SWT.ICON_ERROR屬性代碼示例

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


在下文中一共展示了SWT.ICON_ERROR屬性的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: okPressed

@Override
protected void okPressed() {
    int dbport;
    String port = txtDbPort.getText();
    if(txtDbPort.getText().isEmpty()) {
        dbport = 0;
    } else {
        try {
            dbport = Integer.parseInt(port);
        } catch (NumberFormatException ex) {
            MessageBox mb = new MessageBox(getShell(), SWT.ICON_ERROR);
            mb.setText(Messages.dbStoreEditorDialog_cannot_save_entry);
            mb.setMessage(MessageFormat.format(
                    Messages.dbStoreEditorDialog_not_valid_port_number,
                    port));
            mb.open();
            return;
        }
    }

    dbInfo = new DbInfo(txtName.getText(), txtDbName.getText(),
            txtDbUser.getText(), txtDbPass.getText(),
            txtDbHost.getText(), dbport);
    super.okPressed();
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:25,代碼來源:DbStoreEditorDialog.java

示例3: publish

/**
  * Publish a DownloadManager on our Tracker.
  * <P>
  * Doesn't require SWT Thread
  */
 public static void
 publish(
 		Core core,
	DownloadManager dm)
{
	if (dm == null) {
		return;
	}

	TOTorrent torrent = dm.getTorrent();
	if (torrent == null) {
		return;
	}

	try {
		core.getTrackerHost().publishTorrent(torrent);
	} catch (TRHostException e) {
		MessageBoxShell mb = new MessageBoxShell(
				SWT.ICON_ERROR | SWT.OK,
				MessageText.getString("MyTorrentsView.menu.host.error.title"),
				MessageText.getString("MyTorrentsView.menu.host.error.message").concat(
						"\n").concat(e.toString()));
		mb.open(null);
	}
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:30,代碼來源:ManagerUtils.java

示例4: host

/**
  * Host a DownloadManager on our Tracker.
  * <P>
  * Doesn't require SWT Thread
  */
 public static void
 host(
 	Core core,
DownloadManager dm)
{
	if (dm == null) {
		return;
	}

	TOTorrent torrent = dm.getTorrent();
	if (torrent == null) {
		return;
	}

	try {
		core.getTrackerHost().hostTorrent(torrent, true, false);
	} catch (TRHostException e) {
		MessageBoxShell mb = new MessageBoxShell(
				SWT.ICON_ERROR | SWT.OK,
				MessageText.getString("MyTorrentsView.menu.host.error.title"),
				MessageText.getString("MyTorrentsView.menu.host.error.message").concat(
						"\n").concat(e.toString()));
		mb.open(null);
	}
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:30,代碼來源:ManagerUtils.java

示例5: validateXML

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,代碼行數:21,代碼來源:ELTSchemaGridWidget.java

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

示例7: showSaveError

/**
 * Display the Save error dialog box.
 * @see #save
 * @see #saveAs
 */
protected void showSaveError(IOException ex) {
	Shell finalShell = shell;
	String errorMessage = ex.getMessage();
	if (errorMessage == null) {
		errorMessage = ex.getClass().getName();
	}
	MessageBox box = new MessageBox(finalShell, 
		SWT.ICON_ERROR | SWT.CLOSE);
	box.setText(textBundle.get("SaveDiskImageErrorTitle")); //$NON-NLS-1$
	box.setMessage(textBundle.format("SaveDiskImageErrorMessage", //$NON-NLS-1$
			new Object[] { getDisk(0).getFilename(), errorMessage }));
	box.open();
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:18,代碼來源:DiskExplorerTab.java

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

示例9: 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:AppleCommander,項目名稱:AppleCommander,代碼行數:9,代碼來源:SwtUtil.java

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

示例11: showMessageBox

private void showMessageBox(String exceptionMessage, String message) {
	MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_ERROR);
	if(StringUtils.isNotBlank(exceptionMessage)){
		messageBox.setMessage(message + "\n" + exceptionMessage);
	} else{
		messageBox.setMessage(message);
	}
	messageBox.open();
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:9,代碼來源:ImportEngineXmlWizardPage.java

示例12: 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,項目名稱:KettleEasyExpand,代碼行數:13,代碼來源:JobEntryEasyExpandDialog.java

示例13: getListener

@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,代碼行數:36,代碼來源:OperationClassComboChangeListener.java

示例14: getMessageBoxIcon

private int getMessageBoxIcon(String messageBoxType){
	if(StringUtils.equals(MessageBoxText.ERROR, messageBoxType)){
		return SWT.ICON_ERROR;
	}else if(StringUtils.equals(MessageBoxText.WARNING, messageBoxType)){
		return SWT.ICON_WARNING;
	}else{
		return SWT.ICON_INFORMATION;
	}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:9,代碼來源:Utils.java

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


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