本文整理汇总了Java中com.rapidminer.gui.tools.dialogs.ConfirmDialog.CANCEL_OPTION属性的典型用法代码示例。如果您正苦于以下问题:Java ConfirmDialog.CANCEL_OPTION属性的具体用法?Java ConfirmDialog.CANCEL_OPTION怎么用?Java ConfirmDialog.CANCEL_OPTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.rapidminer.gui.tools.dialogs.ConfirmDialog
的用法示例。
在下文中一共展示了ConfirmDialog.CANCEL_OPTION属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkUnsavedChanges
/** Checks if the user changed any values or have an unsaved Item opened and asks him to save those changes before closing the dialog.
* Returns true if the dialog can be closed, false otherwise.
* @throws ConfigurationException **/
protected boolean checkUnsavedChanges() throws ConfigurationException {
//T inputFieldEntry = getConfigurableFromInputFields();
if (hasUnsavedChanges()) {
// If the user has changed any values / new unsaved entry
int saveBeforeOpen = SwingTools.showConfirmDialog("configuration.dialog.savecurrent", ConfirmDialog.YES_NO_CANCEL_OPTION, getConfigurableFromInputFields().getName());
if (saveBeforeOpen == ConfirmDialog.YES_OPTION) {
// YES: Speichere alles
entrySaved = false;
SAVE_ENTRY_ACTION.actionPerformed(null);
if (entrySaved) {
return true;
} else {
return false;
}
} else if (saveBeforeOpen == ConfirmDialog.NO_OPTION) {
// NO: Verwerfe alles
return true;
} else if (saveBeforeOpen == ConfirmDialog.CANCEL_OPTION) {
return false;
}
}
return true;
}
示例2: ok
@Override
public void ok() {
if (scheduleOnOk) {
String location = processField.getText();
// check if process selected is the same as the current process in the GUI, if so check if it has been edited and ask for save
// before continuing. Otherwise the last version would be executed which can result in confusion (and therefore support tickets..)
if (RapidMinerGUI.getMainFrame().getProcess().getProcessLocation() != null) {
String mainFrameProcessLocString = ((RepositoryProcessLocation) RapidMinerGUI.getMainFrame().getProcess().getProcessLocation()).getRepositoryLocation().getPath();
if (location.equals(mainFrameProcessLocString) && RapidMinerGUI.getMainFrame().isChanged()) {
if (SwingTools.showConfirmDialog("save_before_remote_run", ConfirmDialog.OK_CANCEL_OPTION) == ConfirmDialog.CANCEL_OPTION) {
// user does not want to save "dirty" process, abort
return;
}
SaveAction.save(RapidMinerGUI.getMainFrame().getProcess());
}
}
try {
SchedulerResponse response = ProcessSchedulerFactory.getInstance().getProcessScheduler().scheduleProcess(createProcessScheduleConfig(), null);
Date firstExec = response.getFirstExecution();
SwingTools.showMessageDialog("process_will_first_run", firstExec);
} catch (Exception e) {
SwingTools.showSimpleErrorMessage("run_proc_remote", e.getLocalizedMessage());
return;
}
}
dispose();
}
示例3: exit
public void exit(boolean relaunch) {
if (changed) {
ProcessLocation loc = process.getProcessLocation();
String locName;
if (loc != null) {
locName = loc.getShortName();
} else {
locName = "unnamed";
}
switch (SwingTools.showConfirmDialog("save", ConfirmDialog.YES_NO_CANCEL_OPTION, locName)) {
case ConfirmDialog.YES_OPTION:
SaveAction.save(process);
if (changed)
return;
break;
case ConfirmDialog.NO_OPTION:
break;
case ConfirmDialog.CANCEL_OPTION:
default:
return;
}
} else {
if (!relaunch) { // in this case we have already confirmed
// ask for special confirmation before exiting RapidMiner while a process is running!
if (getProcessState() == Process.PROCESS_STATE_RUNNING || getProcessState() == Process.PROCESS_STATE_PAUSED) {
if (SwingTools.showConfirmDialog("exit_despite_running_process", ConfirmDialog.YES_NO_OPTION) == ConfirmDialog.NO_OPTION) {
return;
}
} else {
int answer = ConfirmDialog.showConfirmDialog("exit", ConfirmDialog.YES_NO_OPTION, RapidMinerGUI.PROPERTY_CONFIRM_EXIT, ConfirmDialog.YES_OPTION);
if (answer != ConfirmDialog.YES_OPTION) {
return;
}
}
}
}
stopProcess();
dispose();
RapidMinerGUI.quit(relaunch ? RapidMiner.ExitMode.RELAUNCH : RapidMiner.ExitMode.NORMAL);
}
示例4: exit
public void exit(final boolean relaunch) {
if (changed) {
ProcessLocation loc = process.getProcessLocation();
String locName;
if (loc != null) {
locName = loc.getShortName();
} else {
locName = "unnamed";
}
switch (SwingTools.showConfirmDialog("save", ConfirmDialog.YES_NO_CANCEL_OPTION, locName)) {
case ConfirmDialog.YES_OPTION:
SaveAction.save(process);
if (changed) {
return;
}
break;
case ConfirmDialog.NO_OPTION:
break;
case ConfirmDialog.CANCEL_OPTION:
default:
return;
}
} else {
if (!relaunch) { // in this case we have already confirmed
// ask for special confirmation before exiting RapidMiner while a process is
// running!
if (getProcessState() == Process.PROCESS_STATE_RUNNING
|| getProcessState() == Process.PROCESS_STATE_PAUSED) {
if (SwingTools.showConfirmDialog("exit_despite_running_process",
ConfirmDialog.YES_NO_OPTION) == ConfirmDialog.NO_OPTION) {
return;
}
} else {
int answer = ConfirmDialog.showConfirmDialog(ApplicationFrame.getApplicationFrame(), "exit",
ConfirmDialog.YES_NO_OPTION, RapidMinerGUI.PROPERTY_CONFIRM_EXIT, ConfirmDialog.YES_OPTION);
if (answer != ConfirmDialog.YES_OPTION) {
return;
}
}
}
}
stopProcess();
dispose();
RapidMiner.quit(relaunch ? RapidMiner.ExitMode.RELAUNCH : RapidMiner.ExitMode.NORMAL);
}
示例5: exit
public void exit(final boolean relaunch) {
if (isChanged()) {
ProcessLocation loc = getProcess().getProcessLocation();
String locName;
if (loc != null) {
locName = loc.getShortName();
} else {
locName = "unnamed";
}
switch (SwingTools.showConfirmDialog("save", ConfirmDialog.YES_NO_CANCEL_OPTION, locName)) {
case ConfirmDialog.YES_OPTION:
SaveAction.save(getProcess());
if (isChanged()) {
return;
}
break;
case ConfirmDialog.NO_OPTION:
break;
case ConfirmDialog.CANCEL_OPTION:
default:
return;
}
} else {
if (!relaunch) { // in this case we have already confirmed
// ask for special confirmation before exiting RapidMiner while a process is
// running!
if (getProcessState() == Process.PROCESS_STATE_RUNNING
|| getProcessState() == Process.PROCESS_STATE_PAUSED) {
if (SwingTools.showConfirmDialog("exit_despite_running_process",
ConfirmDialog.YES_NO_OPTION) == ConfirmDialog.NO_OPTION) {
return;
}
} else {
int answer = ConfirmDialog.showConfirmDialog(ApplicationFrame.getApplicationFrame(), "exit",
ConfirmDialog.YES_NO_OPTION, RapidMinerGUI.PROPERTY_CONFIRM_EXIT, ConfirmDialog.YES_OPTION);
if (answer != ConfirmDialog.YES_OPTION) {
return;
}
}
}
}
stopProcess();
dispose();
RapidMiner.quit(relaunch ? RapidMiner.ExitMode.RELAUNCH : RapidMiner.ExitMode.NORMAL);
}
示例6: actionPerformed
@Override
public void actionPerformed(ActionEvent e) {
boolean deletedEntry = false;
Object[] selectedValues = configurableList.getSelectedValues();
boolean applyToAll = false;
int returnOption = ConfirmDialog.CANCEL_OPTION;
for (int i = 0; i < selectedValues.length; i++) {
Configurable entry = (Configurable) selectedValues[i];
if (!applyToAll) {
MultiConfirmDialog dialog = new MultiConfirmDialog("configuration.dialog.delete", ConfirmDialog.YES_NO_CANCEL_OPTION, entry.getName());
dialog.setVisible(true);
applyToAll = dialog.applyToAll();
returnOption = dialog.getReturnOption();
}
if (returnOption == ConfirmDialog.CANCEL_OPTION) {
break;
}
if (returnOption == ConfirmDialog.YES_OPTION) {
model.removeElement(entry);
ConfigurationManager.getInstance().removeConfigurable(configurator.getTypeId(), entry.getName());
isNewEntry = false;
NEW_ENTRY_ACTION.setEnabled(true);
deletedEntry = true;
configurableList.clearSelection();
for (int j = 0; j < selectedValues.length; j++) {
int index = model.indexOf(selectedValues[j]);
configurableList.getSelectionModel().addSelectionInterval(index, index);
}
}
}
if (deletedEntry) {
if (configurableList.getModel().getSize() > 0) {
hideListChangeConfirmationDialog = true;
configurableList.setSelectedIndex(0);
hideListChangeConfirmationDialog = false;
} else {
openEntry(null);
}
save();
}
}