use of org.eclipse.jface.dialogs.MessageDialog in project webtools.servertools by eclipse.
the class ServerUIPlugin method promptIfDirty.
/**
* Prompts the user if the server is dirty. Returns true if the server was
* not dirty or if the user decided to continue anyway. Returns false if
* the server is dirty and the user chose to cancel the operation.
*
* @param shell a shell
* @param server a server
* @return boolean
*/
public static boolean promptIfDirty(Shell shell, IServer server) {
if (server == null)
return false;
if (!(server instanceof IServerWorkingCopy))
return true;
String title = Messages.resourceDirtyDialogTitle;
IServerWorkingCopy wc = (IServerWorkingCopy) server;
if (wc.isDirty()) {
String message = NLS.bind(Messages.resourceDirtyDialogMessage, server.getName());
String[] labels = new String[] { Messages.resourceDirtyDialogContinue, IDialogConstants.CANCEL_LABEL };
MessageDialog dialog = new MessageDialog(shell, title, null, message, MessageDialog.INFORMATION, labels, 0);
if (dialog.open() != 0)
return false;
}
return true;
}
use of org.eclipse.jface.dialogs.MessageDialog in project mdw-designer by CenturyLinkCloud.
the class ProcessEditor method promptToSaveOverrideAttributes.
private int promptToSaveOverrideAttributes() {
String msg = getProcess().getName() + " has unsaved override attributes. Save changes?";
String[] buttons = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL };
MessageDialog attrsSaveDialog = new MessageDialog(getSite().getShell(), "Save Attributes", null, msg, MessageDialog.QUESTION, buttons, 0);
return attrsSaveDialog.open();
}
use of org.eclipse.jface.dialogs.MessageDialog in project azure-tools-for-java by Microsoft.
the class HDInsightHelperImpl method createRefreshHdiReaderStorageAccountsWarningForm.
public void createRefreshHdiReaderStorageAccountsWarningForm(@NotNull RefreshableNode node, @NotNull String aseDeepLink) {
Display.getDefault().asyncExec(() -> {
String title = "Storage Access Denied";
String warningText = "You have Read-only permission for this cluster. Please ask the cluster owner or user " + "access administrator to upgrade your role to HDInsight Cluster Operator in the Azure Portal, or " + "use Azure Storage Explorer to access the storages associated with this cluster.";
// String[] dialogButtonLabels = new String[] {"Link this cluster", "Cancel"};
String[] dialogButtonLabels = new String[] { "Ok" };
MessageDialog warningDialog = new MessageDialog(PluginUtil.getParentShell(), title, null, warningText, MessageDialog.WARNING, dialogButtonLabels, 0);
warningDialog.open();
// if (warningDialog.open() == 0) {
// try {
// DefaultLoader.getIdeHelper().openLinkInBrowser(aseDeepLink);
// } catch (Exception ex) {
// DefaultLoader.getUIHelper().showError(ex.getMessage(), "HDInsight Explorer");
// }
// }
});
}
use of org.eclipse.jface.dialogs.MessageDialog in project azure-tools-for-java by Microsoft.
the class HDInsightHelperImpl method createRefreshHdiLinkedClusterStorageAccountsWarningForm.
public void createRefreshHdiLinkedClusterStorageAccountsWarningForm(@NotNull RefreshableNode node, @NotNull String aseDeepLink) {
Display.getDefault().asyncExec(() -> {
String title = "Storage Access Denied";
String warningText = "You are only linked to HDInsight cluster through Ambari credentials. Please use Azure " + "Storage Explorer to access the storage associated with this cluster.";
// String[] dialogButtonLabels = new String[] {"Open Azure Storage Explorer", "Cancel"};
String[] dialogButtonLabels = new String[] { "Ok" };
MessageDialog warningDialog = new MessageDialog(PluginUtil.getParentShell(), title, null, warningText, MessageDialog.WARNING, dialogButtonLabels, 0);
warningDialog.open();
// if (warningDialog.open() == 0) {
// try {
// DefaultLoader.getIdeHelper().openLinkInBrowser(aseDeepLink);
// } catch (Exception ex) {
// DefaultLoader.getUIHelper().showError(ex.getMessage(), "HDInsight Explorer");
// }
// }
});
}
use of org.eclipse.jface.dialogs.MessageDialog in project azure-tools-for-java by Microsoft.
the class HDInsightHelperImpl method createRefreshHdiReaderJobsWarningForm.
public void createRefreshHdiReaderJobsWarningForm(@NotNull HDInsightRootModule module, @NotNull ClusterDetail clusterDetail) {
Display.getDefault().asyncExec(() -> {
String title = "Cluster Job Access Denied";
String warningText = "You have Read-only permission for this cluster. Please ask the cluster owner or user " + "access administrator to upgrade your role to HDInsight Cluster Operator in the Azure Portal, or " + "‘Link this cluster’ through Ambari credentials to view the corresponding jobs.";
String[] dialogButtonLabels = new String[] { "Link this cluster", "Cancel" };
MessageDialog warningDialog = new MessageDialog(PluginUtil.getParentShell(), title, null, warningText, MessageDialog.WARNING, dialogButtonLabels, 0);
if (warningDialog.open() == 0) {
// First button pressed
AddNewHDInsightReaderClusterForm linkClusterForm = new AddNewHDInsightReaderClusterForm(PluginUtil.getParentShell(), module, clusterDetail);
linkClusterForm.open();
}
});
}
Aggregations