本文整理汇总了Java中org.eclipse.jface.dialogs.MessageDialog.open方法的典型用法代码示例。如果您正苦于以下问题:Java MessageDialog.open方法的具体用法?Java MessageDialog.open怎么用?Java MessageDialog.open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.dialogs.MessageDialog
的用法示例。
在下文中一共展示了MessageDialog.open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: execute
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
this.candidateToTypeChanging = new ArrayList<IMarker>();
this.deleteMarkers();
this.refresh();
if (AlloyUtilities.isExists()) {
this.candidateToTypeChanging = new ArrayList<IMarker>();
this.deleteMarkers();
this.refresh();
} else {
final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
"System Information", null, "You dont have any registered alloy file to system.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例3: 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;
}
示例4: nextPressed
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
@Override
public boolean nextPressed() throws Exception {
// if save enabled, make sure pred has a name that not starts with number
if (saveEnabled && (Character.isDigit(getPredName().charAt(0)) || getPredName().isEmpty())) {
predText.forceFocus();
return false;
}
String predName = getPredName();
if (!saveEnabled)
predName = "temp_pred_name";
A4Solution solution =
getAlloyToEMF().executePred(predName, generatePredAndRun(predName), saveEnabled);
if (solution != null) {
AlloySolutionSelectionPage nextPage = (AlloySolutionSelectionPage) getNextPage();
nextPage.setFirstSolution(solution);
return true;
} else {
MessageDialog messageDialog = new MessageDialog(getShell(), "Error", null,
"No instance found, try changing the bounds.", MessageDialog.INFORMATION, 0,
new String[] {"OK"});
messageDialog.open();
return false;
}
}
示例5: open
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
@Override
public void open() {
final IFile file = MarkerActivator.getEditor().getEditorInput().getAdapter(IFile.class);
final int start = this.fUrlRegion.getOffset();
final int end = this.fUrlRegion.getOffset() + this.fUrlRegion.getLength();
final IMarker beMapped = MarkerFactory.findMarkerWithAbsolutePosition(file, start, end);
if (beMapped != null) {
MarkerMapping.getInstance().runWithMarker(beMapped);
} else {
final MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Mark Information",
null, "Something goes wrong with this text fragments", MessageDialog.WARNING,
new String[] {"OK"}, 0);
dialog.open();
}
}
示例6: run
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
@Override
public void run() {
if (AlloyUtilities.isExists()) {
if (this.marker != null && this.marker.exists()) {
MappingCommand.chooseForAction(this.marker);
} else {
final MessageDialog dialog =
new MessageDialog(Activator.getShell(), "There is no marker in this position", null,
"Please select valid marker", MessageDialog.INFORMATION, new String[] {"OK"}, 0);
dialog.open();
}
} else {
final MessageDialog infoDialog = new MessageDialog(Activator.getShell(), "System Information",
null, "You dont have any registered alloy file to system.", MessageDialog.INFORMATION,
new String[] {"OK"}, 0);
infoDialog.open();
}
}
示例7: execute
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final MessageDialog warningdialog =
new MessageDialog(MarkerActivator.getShell(), "Mark Information", null,
"If new alloy file will be parsed , your all marker type will be lost !",
MessageDialog.WARNING, new String[] {"OK", "Cancel"}, 0);
if (warningdialog.open() != 0) {
return null;
}
final String filePath = getFilePath();
if (filePath == null) {
return null;
}
AlloyParseUtil.parse(filePath);
try {
TraceManager.get().loadSpec(filePath);
} catch (final TraceException e) {
e.printStackTrace();
}
return null;
}
示例8: execute
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
if (AlloyUtilities.isExists()) {
MarkerMapping.getInstance().runWithSelection();
if (Activator.getDefault().getWorkbench().getWorkbenchWindows()[0].getActivePage()
.findView(Visualization.ID) != null) {
Visualization.showViz();
}
} else {
final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
"System Information", null, "You dont have any registered alloy file to system.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例9: execute
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
if (AlloyUtilities.isExists()) {
createMarker();
refresh();
} else {
final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
"System Information", null, "You dont have any registered alloy file to system.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例10: openWizardForModule
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
/**
* Opens the wizard with the given id and passes it the selection.
*
* @param wizardId
* The wizard id of the eclipse newWizard registry
* @param selection
* The selection
*/
private void openWizardForModule(String wizardId, IStructuredSelection selection, boolean nested) {
// Retrieve wizard from registry
IWizardDescriptor wizardDescriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(wizardId);
if (wizardDescriptor == null) {
return;
}
try {
IWorkbenchWizard wizard = wizardDescriptor.createWizard();
// Inject wizard members
injector.injectMembers(wizard);
// Create and open a new wizard dialog
WizardDialog wizardDialog = new WizardDialog(UIUtils.getShell(), wizard);
// If the wizard supports it, enable in module option
if (wizard instanceof N4JSNewClassifierWizard<?>) {
((N4JSNewClassifierWizard<?>) wizard).init(PlatformUI.getWorkbench(), selection, nested);
} else {
// Otherwise just pass it the initial selection
wizard.init(PlatformUI.getWorkbench(), selection);
}
// wizardDialog.setTitle(wizard.getWindowTitle());
wizardDialog.open();
} catch (CoreException e) {
/** Failed to create the wizard */
Shell workbenchShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
MessageDialog.open(MessageDialog.ERROR, workbenchShell, "Failed to launch wizard",
String.format("Failed to launch wizard %s", wizardId), SWT.SHEET);
return;
}
}
示例11: execute
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (AlloyUtilities.isExists()) {
this.createMarkers();
this.refresh();
} else {
MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(), "System Information",
null, "You dont have any registered alloy file to system.", MessageDialog.INFORMATION,
new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例12: createMarkersWs
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
private void createMarkersWs() {
ITextSelection textSelection = (ITextSelection) this.selection;
if (MarkerFactory.findMarkerWithAbsolutePosition(this.file, textSelection.getOffset(),
textSelection.getOffset() + textSelection.getLength()) != null) {
MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Mark Information", null,
"In these area, there is already a marker", MessageDialog.WARNING, new String[] {"OK"},
0);
dialog.open();
return;
} else {
MarkAllInWsWizard markAllWsWizard = new MarkAllInWsWizard(textSelection, this.file);
WizardDialog selectionDialog = new WizardDialog(MarkerActivator.getShell(), markAllWsWizard);
selectionDialog.open();
}
}
示例13: removeType
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
private void removeType(IMarker selectedMarker) {
selectedMarker = AnnotationFactory.convertAnnotationType(selectedMarker, true, true,
AlloyUtilities.getTotalTargetCount(selectedMarker));
IMarker marker = null;
for (int i = 1; i < this.candidateToTypeChanging.size(); i++) {
marker = this.candidateToTypeChanging.get(i);
AnnotationFactory.convertAnnotationType(marker, true,
MarkUtilities.compare(marker, selectedMarker),
AlloyUtilities.getTotalTargetCount(marker));
}
AlloyUtilities.removeAllRelationsOfMarker(selectedMarker);
AlloyUtilities.removeRelationOfMarker(selectedMarker);
if (MarkUtilities.getGroupId(selectedMarker) != null) {
final List<IMarker> group = MarkerFactory.findMarkersByGroupId(selectedMarker.getResource(),
MarkUtilities.getGroupId(selectedMarker));
for (final IMarker iMarker : group) {
AlloyUtilities.removeTypeFromMarker(iMarker);
MarkUtilities.setType(iMarker, null);
}
} else {
AlloyUtilities.removeTypeFromMarker(selectedMarker);
MarkUtilities.setType(selectedMarker, null);
}
final MessageDialog removeSuccessDialog = new MessageDialog(Activator.getShell(),
"Removing Type Action", null, "Selected marker's type has been removed.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
removeSuccessDialog.open();
}
示例14: displayYesNoQuestion
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
public static int displayYesNoQuestion(String title, String text) {
if (isAutomatedMode ()) return getIntegerAutomatedModeDefaultValue();
MessageDialog dialog = new MessageDialog(null, title, null, text, MessageDialog.QUESTION,
new String[] { MessageUtil.getString("yes"), MessageUtil.getString("no") }, 0);
int result = dialog.open();
return result;
}
示例15: Message_Dialog
import org.eclipse.jface.dialogs.MessageDialog; //导入方法依赖的package包/类
/**
*
* Message dialog to be displayed if compare_fields() method returns false.
*
*/
public int Message_Dialog()
{
MessageDialog dialog = new MessageDialog(Display.getCurrent().getActiveShell(), "Rearrange Fields", null,
Messages.HIVE_PARTI_SEQ_ERROR, MessageDialog.ERROR, new String[] { "Rearrange Schema",
"Rearrange Partition Fields" }, 0);
int result = dialog.open();
return result;
}