本文整理匯總了Java中org.eclipse.jface.dialogs.ErrorDialog.open方法的典型用法代碼示例。如果您正苦於以下問題:Java ErrorDialog.open方法的具體用法?Java ErrorDialog.open怎麽用?Java ErrorDialog.open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.dialogs.ErrorDialog
的用法示例。
在下文中一共展示了ErrorDialog.open方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: saveWithoutDeploying
import org.eclipse.jface.dialogs.ErrorDialog; //導入方法依賴的package包/類
public void saveWithoutDeploying() {
try {
saveParFile(createParBytes(getProjectClasspathUrls()));
} catch (Exception e) {
Logger.logError(e);
ErrorDialog dialog = new ErrorDialog(shell,
"Unexpected Exception While Saving",
"An exception happened while saving the process definition archive",
new Status(
Status.ERROR,
ActivitiPlugin.getDefault().getBundle()
.getSymbolicName(),
Status.ERROR,
"An unexpected exception caused the save operation to fail",
e), Status.ERROR);
dialog.open();
}
}
示例2: handleFinishedDropMove
import org.eclipse.jface.dialogs.ErrorDialog; //導入方法依賴的package包/類
private void handleFinishedDropMove(DragSourceEvent event) {
MultiStatus status= new MultiStatus(
JavaPlugin.getPluginId(),
IJavaStatusConstants.INTERNAL_ERROR,
JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_resource,
null);
List<IResource> resources= convertSelection();
for (Iterator<IResource> iter= resources.iterator(); iter.hasNext();) {
IResource resource= iter.next();
try {
resource.delete(true, null);
} catch (CoreException e) {
status.add(e.getStatus());
}
}
int childrenCount= status.getChildren().length;
if (childrenCount > 0) {
Shell parent= SWTUtil.getShell(event.widget);
ErrorDialog error= new ErrorDialog(parent,
JavaUIMessages.ResourceTransferDragAdapter_moving_resource,
childrenCount == 1 ? JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_singular : Messages.format(
JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_plural, String.valueOf(childrenCount)), status, IStatus.ERROR);
error.open();
}
}
示例3: openError
import org.eclipse.jface.dialogs.ErrorDialog; //導入方法依賴的package包/類
public static int openError(
final Shell parentShell,
final String title,
final String message,
final IStatus status,
final int displayMask) {
final ErrorDialog dialog = new TeamExplorerErrorDialog(parentShell, title, message, status, displayMask);
return dialog.open();
}
示例4: showErrorDialog
import org.eclipse.jface.dialogs.ErrorDialog; //導入方法依賴的package包/類
private void showErrorDialog(Throwable t) {
ErrorDialog dialog = new ErrorDialog(shell,
"Unexpected Deployment Exception",
"An exception happened during the deployment of the process",
new Status(
Status.ERROR,
ActivitiPlugin.getDefault().getBundle()
.getSymbolicName(),
Status.ERROR,
"An unexpected exception caused the deployment to fail",
t), Status.ERROR);
dialog.open();
}
示例5: openSaveListenerWarningDialog
import org.eclipse.jface.dialogs.ErrorDialog; //導入方法依賴的package包/類
/**
* Opens a warning dialog informing about a failure during handling of save listeners.
*
* @param title the dialog title
* @param message the message to display
* @param exception the exception to handle
* @since 3.4
*/
private void openSaveListenerWarningDialog(String title, String message, CoreException exception) {
final String linkText;
final IJavaProject javaProject= getInputJavaElement().getJavaProject();
IProject project= javaProject != null ? javaProject.getProject() : null;
final boolean hasProjectSettings= project != null && CleanUpPreferenceUtil.hasSettingsInScope(new ProjectScope(project));
if (exception.getStatus().getCode() == IJavaStatusConstants.EDITOR_POST_SAVE_NOTIFICATION) {
message= JavaEditorMessages.CompilationUnitEditor_error_saving_participant_message;
if (hasProjectSettings)
linkText= JavaEditorMessages.CompilationUnitEditor_error_saving_participant_property_link;
else
linkText= JavaEditorMessages.CompilationUnitEditor_error_saving_participant_link;
} else {
message= JavaEditorMessages.CompilationUnitEditor_error_saving_editedLines_calculation_message;
if (hasProjectSettings)
linkText= JavaEditorMessages.CompilationUnitEditor_error_saving_editedLines_calculation_property_link;
else
linkText= JavaEditorMessages.CompilationUnitEditor_error_saving_editedLines_calculation_link;
}
IStatus status= exception.getStatus();
int mask= IStatus.WARNING | IStatus.ERROR;
ErrorDialog dialog= new ErrorDialog(getSite().getShell(), title, message, status, mask) {
@Override
protected Control createMessageArea(Composite parent) {
Control result= super.createMessageArea(parent);
// Panic code: use 'parent' instead of 'result' in case super implementation changes in the future
new Label(parent, SWT.NONE); // filler as parent has 2 columns (icon and label)
Link link= new Link(parent, SWT.NONE);
link.setText(linkText);
link.setFont(parent.getFont());
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (hasProjectSettings)
PreferencesUtil.createPropertyDialogOn(getShell(), javaProject, SaveParticipantPreferencePage.PROPERTY_PAGE_ID, null, null).open();
else
PreferencesUtil.createPreferenceDialogOn(getShell(), SaveParticipantPreferencePage.PREFERENCE_PAGE_ID, null, null).open();
}
});
GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
link.setLayoutData(gridData);
return result;
}
@Override
protected Image getImage() {
return getWarningImage();
}
};
dialog.open();
}
示例6: alert
import org.eclipse.jface.dialogs.ErrorDialog; //導入方法依賴的package包/類
private void alert(String str) {
ErrorDialog msgDialog = new ErrorDialog(this.getShell(), "", str, new ResourceStatus(1, ""), 1);
msgDialog.create();
msgDialog.open();
}
示例7: configTableOnDoubleClick
import org.eclipse.jface.dialogs.ErrorDialog; //導入方法依賴的package包/類
/**
* 雙擊lTableTo,彈出配置表的對話框
*
* @param lTableTo
* @param lTableStatus
*/
private void configTableOnDoubleClick(List lTableTo, List lTableStatus) {
String currentTable = lTableTo.getItem(lTableTo.getFocusIndex());
File currentTableXmlFile = new File(RmXmlHelper.formatToFile(QbXmlGenerateCodePlugin.qbGenerateCodeHome + "/" + getLongTableXmlName(currentTable)));
if (connectDatabase()) {
try {
if (gcRule.getMTableDocs().get(currentTable) == null) { //如果內存中沒有xml
gcRule.initTableDoc(currentTable, currentTableXmlFile, pdmParser, this);
//QbXmlGenerateCodePlugin.log("save file '" + currentTableXmlFile.getPath() + "', before dialog");
RmXmlHelper.saveXmlToPath((Document) gcRule.getMTableDocs().get(currentTable), currentTableXmlFile.getPath());
}
{ //彈出對話框,並等其點OK後,把值保存回去xml
ConfigTableDialog dialog = new ConfigTableDialog(this.getShell(), this, currentTable, gcRule);
dialog.create();
if (dialog.open() == ContainerSelectionDialog.OK) {
//QbXmlGenerateCodePlugin.log("save file '" + currentTableXmlFile.getPath() + "', after OK");
RmXmlHelper.saveXmlToPath((Document) gcRule.getMTableDocs().get(currentTable), currentTableXmlFile.getPath());
}
}
lTableStatus.setItem(lTableTo.getFocusIndex(), "finished");
{ //刪除xml中的已選狀態,回寫tableTos/@xmlName
Node thisTableTo = getNodeFromXmlByText("/rules/database/tableTos/tableTo", currentTable, gcRule.getMainRule());
if (thisTableTo == null) {
Element thisTableTos = (Element) gcRule.getMainRule().selectSingleNode("/rules/database/tableTos");
Element thisTableToEle = thisTableTos.addElement("tableTo");
thisTableToEle.setText(currentTable);
thisTableToEle.addAttribute("xmlName", getLongTableXmlName(currentTable));
} else {
Node thisXmlName = thisTableTo.selectSingleNode("@xmlName");
thisXmlName.setText(getLongTableXmlName(currentTable));
}
}
} catch (Exception e) {
e.printStackTrace();
ErrorDialog msgDialog = new ErrorDialog(this.getShell(), "", "不能生成此表", new ResourceStatus(1, "\n從 " + currentTable + " 表生成xml定義文件時錯誤!\n\n" + e.toString()), 1);
msgDialog.create();
msgDialog.open();
}
}
}