use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class EncodingSelector method initBindings.
protected void initBindings() {
// init static models...
this.systemEncoding = detectPlatformEncoding();
Vector allEncodings = supportedEncodings(systemEncoding);
view.getEncodingChoices().setModel(new DefaultComboBoxModel(allEncodings));
view.getDefaultEncodingLabel().setText("Default (" + systemEncoding + ")");
view.getDefaultEncoding().setSelected(true);
// create bindings...
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
this.defaultEncodingBinding = builder.bindToStateChange(view.getDefaultEncoding(), "defaultEncoding");
this.otherEncodingBinding = builder.bindToStateChange(view.getOtherEncoding(), "otherEncoding");
this.selectedEncodingBinding = builder.bindToComboSelection(view.getEncodingChoices(), "encoding");
}
use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class GeneralPreferences method initBindings.
protected void initBindings() {
// init model objects
preferences = application.getPreferencesNode(GeneralPreferences.class, "");
this.encoding = preferences.get(ENCODING_PREFERENCE, null);
this.autoLoadProjectPreference = preferences.getBoolean(AUTO_LOAD_PROJECT_PREFERENCE, false);
this.deletePromptPreference = preferences.getBoolean(DELETE_PROMPT_PREFERENCE, false);
// build child controllers...
EncodingSelector encodingSelector = new EncodingSelector(this, view.getEncodingSelector());
// create bindings...
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
this.encodingBinding = builder.bindToProperty(encodingSelector, "encoding", EncodingSelector.ENCODING_PROPERTY_BINDING);
this.autoLoadProjectBinding = builder.bindToCheckBox(view.getAutoLoadProject(), "autoLoadProject");
this.deletePromptBinding = builder.bindToCheckBox(view.getDeletePrompt(), "deletePrompt");
}
use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class TemplateCreator method initBindings.
protected void initBindings() {
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
builder.bindToAction(view.getCancelButton(), "cancelAction()");
builder.bindToAction(view.getOkButton(), "okAction()");
final FSPath path = getLastTemplateDirectory();
view.getTemplateChooser().setCurrentDirectory(path.getExistingDirectory(false));
view.getTemplateChooser().addPropertyChangeListener(FileChooser.CURRENT_DIRECTORY_PROPERTY, new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
File directory = view.getTemplateChooser().getCurrentDirectory();
path.setDirectory(directory);
}
});
}
use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class InferRelationshipsController method initBindings.
protected void initBindings() {
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
builder.bindToAction(view.getCancelButton(), "cancelAction()");
builder.bindToAction(view.getGenerateButton(), "generateAction()");
builder.bindToAction(this, "entitySelectedAction()", SELECTED_PROPERTY);
builder.bindToAction(view.getStrategyCombo(), "strategyComboAction()");
}
use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class GeneratorTabController method initBindings.
protected void initBindings() {
// bind actions
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
builder.bindToAction(view.getGenerationMode(), "updateModeAction()");
CayenneProjectPreferences cayPrPref = application.getCayenneProjectPreferences();
this.preferences = (PreferenceDetail) cayPrPref.getProjectDetailObject(PreferenceDetail.class, getViewPreferences().node("controller"));
if (Util.isEmptyString(preferences.getProperty("mode"))) {
preferences.setProperty("mode", STANDARD_OBJECTS_MODE);
}
builder.bindToComboSelection(view.getGenerationMode(), "preferences.property['mode']").updateView();
updateModeAction();
}
Aggregations