本文整理汇总了Java中com.rapidminer.tools.config.ConfigurationException类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationException类的具体用法?Java ConfigurationException怎么用?Java ConfigurationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationException类属于com.rapidminer.tools.config包,在下文中一共展示了ConfigurationException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkUnsavedChanges
import com.rapidminer.tools.config.ConfigurationException; //导入依赖的package包/类
/** 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: hasUnsavedChanges
import com.rapidminer.tools.config.ConfigurationException; //导入依赖的package包/类
/** Returns true if the user has changed any values and hasn't saved them, false otherwise **/
private boolean hasUnsavedChanges() throws ConfigurationException {
if (currentlyEditedEntry == null) {
// The first time the user selects an entry, make sure everything is empty or the default value
if (getConfigurableFromInputFields().isEmptyOrDefault(configurator)) {
return false;
} else {
return true;
}
} else {
if (isNewEntry) {
// If it's a new entry, it needs to be saved
return true;
} else {
// If it's an entry which existed before, check if the values have changed
T inputFieldsEntry = getConfigurableFromInputFields();
if (currentlyEditedEntry.hasSameValues(inputFieldsEntry)) {
return false;
} else {
return true;
}
}
}
}
示例3: loadEntries
import com.rapidminer.tools.config.ConfigurationException; //导入依赖的package包/类
private void loadEntries() {
List<String> entryNames = ConfigurationManager.getInstance().getAllConfigurableNames(configurator.getTypeId());
for (String entryName : entryNames) {
try {
addEntries(ConfigurationManager.getInstance().lookup(configurator.getTypeId(), entryName, null));
} catch (ConfigurationException e) {
SwingTools.showSimpleErrorMessage("configuration.dialog.general", e, e.getMessage());
return;
}
}
}
示例4: actionPerformed
import com.rapidminer.tools.config.ConfigurationException; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
String alias = "New item ";
boolean unique = false;
int appendIndex = 1;
do {
for (int i = 0; i < model.getSize(); i++) {
unique = true;
Configurable compareEntry = (Configurable) model.getElementAt(i);
if (compareEntry.getName().equals(alias + appendIndex)) {
unique = false;
appendIndex++;
break;
}
}
// do as often as needed until we have a unique name (model must have elements otherwise we have an infinite loop
} while(!unique && model.getSize() > 0);
T newEntry = null;
try {
newEntry = configurator.create(alias + appendIndex, Collections.<String,String>emptyMap());
} catch (ConfigurationException e1) {
SwingTools.showSimpleErrorMessage("configuration.dialog.general", e1, e1.getMessage());
return;
}
model.addElement(newEntry);
configurableList.setSelectedValue(newEntry, true);
isNewEntry = true;
openEntry(newEntry);
NEW_ENTRY_ACTION.setEnabled(false);
CLONE_ENTRY_ACTION.setEnabled(false);
}
示例5: getConfigurableFromInputFields
import com.rapidminer.tools.config.ConfigurationException; //导入依赖的package包/类
/** Resolves the Configurable which derives from the input field values **/
protected T getConfigurableFromInputFields() throws ConfigurationException {
T tempEntry = configurator.create("Temp", Collections.<String,String>emptyMap());;
configurationPanel.updateConfigurable(tempEntry);
return tempEntry;
//SwingTools.showSimpleErrorMessage("configuration.dialog.general", e1, e1.getMessage());
}
示例6: save
import com.rapidminer.tools.config.ConfigurationException; //导入依赖的package包/类
private void save() {
try {
ConfigurationManager.getInstance().saveConfiguration(configurator.getTypeId());
} catch (ConfigurationException e) {
SwingTools.showSimpleErrorMessage("configuration.dialog.failed_to_save_configurable", e, configurator.getName(), e.getMessage());
}
}
示例7: addConfigurable
import com.rapidminer.tools.config.ConfigurationException; //导入依赖的package包/类
/**
* Creates a {@link Configurable} of the specified type with the given name and the given remote
* repository.
*
* @param typeId
* type of the configurable
* @param name
* name of the configurable
* @param source
* {@link RemoteRepository} (source) of the configurable, can be null in case of
* local connections
*/
protected void addConfigurable(String typeId, String name, RemoteRepository source) {
try {
Configurable newConfigurable = ConfigurationManager.getInstance().createWithoutRegistering(typeId, name, source);
model.addConfigurable(newConfigurable);
} catch (ConfigurationException e) {
LogService.getRoot().log(Level.WARNING, "com.rapidminer.tools.config.gui.ConfigurableController.unknown_type",
typeId);
}
}