use of org.apache.cayenne.modeler.util.TextAdapter in project cayenne by apache.
the class DataDomainView method initView.
protected void initView() {
// create widgets
this.name = new TextAdapter(new JTextField()) {
protected void updateModel(String text) {
setDomainName(text);
}
};
this.objectValidation = new JCayenneCheckBox();
this.sharedCache = new JCayenneCheckBox();
// assemble
CellConstraints cc = new CellConstraints();
FormLayout layout = new FormLayout("right:pref, 3dlu, fill:50dlu, 3dlu, fill:47dlu, 3dlu, fill:100", "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p");
PanelBuilder builder = new PanelBuilder(layout);
builder.setDefaultDialogBorder();
builder.addSeparator("DataDomain Configuration", cc.xywh(1, 1, 7, 1));
builder.addLabel("DataDomain Name:", cc.xy(1, 3));
builder.add(name.getComponent(), cc.xywh(3, 3, 5, 1));
builder.addLabel("Object Validation:", cc.xy(1, 5));
builder.add(objectValidation, cc.xy(3, 5));
builder.addLabel("Use Shared Cache:", cc.xy(1, 7));
builder.add(sharedCache, cc.xy(3, 7));
this.setLayout(new BorderLayout());
this.add(builder.getPanel(), BorderLayout.CENTER);
}
use of org.apache.cayenne.modeler.util.TextAdapter in project cayenne by apache.
the class DataMapView method initView.
private void initView() {
// create widgets
name = new TextAdapter(new JTextField()) {
protected void updateModel(String text) {
setDataMapName(text);
}
};
location = new JLabel();
nodeSelector = Application.getWidgetFactory().createUndoableComboBox();
nodeSelector.setRenderer(CellRenderers.listRendererWithIcons());
updateDefaultCatalog = new JButton("Update...");
defaultCatalog = new TextAdapter(new JTextField()) {
protected void updateModel(String text) {
setDefaultCatalog(text);
}
};
updateDefaultSchema = new JButton("Update...");
defaultSchema = new TextAdapter(new JTextField()) {
protected void updateModel(String text) {
setDefaultSchema(text);
}
};
quoteSQLIdentifiers = new JCayenneCheckBox();
comment = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) throws ValidationException {
updateComment(text);
}
};
updateDefaultPackage = new JButton("Update...");
defaultPackage = new TextAdapter(new JTextField()) {
protected void updateModel(String text) {
setDefaultPackage(text);
}
};
updateDefaultSuperclass = new JButton("Update...");
defaultSuperclass = new TextAdapter(new JTextField()) {
protected void updateModel(String text) {
setDefaultSuperclass(text);
}
};
updateDefaultLockType = new JButton("Update...");
defaultLockType = new JCayenneCheckBox();
clientSupport = new JCayenneCheckBox();
updateDefaultClientPackage = new JButton("Update...");
defaultClientPackage = new TextAdapter(new JTextField()) {
protected void updateModel(String text) {
setDefaultClientPackage(text);
}
};
updateDefaultClientSuperclass = new JButton("Update...");
defaultClientSuperclass = new TextAdapter(new JTextField()) {
protected void updateModel(String text) {
setDefaultClientSuperclass(text);
}
};
// assemble
FormLayout layout = new FormLayout("right:70dlu, 3dlu, fill:180dlu, 3dlu, fill:120", "");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.setDefaultDialogBorder();
builder.appendSeparator("DataMap Configuration");
builder.append("DataMap Name:", name.getComponent(), 2);
builder.append("File:", location, 3);
builder.append("DataNode:", nodeSelector, 2);
builder.append("Quote SQL Identifiers:", quoteSQLIdentifiers, 3);
builder.append("Comment:", comment.getComponent(), 2);
builder.appendSeparator("Entity Defaults");
builder.append("DB Catalog:", defaultCatalog.getComponent(), updateDefaultCatalog);
builder.append("DB Schema:", defaultSchema.getComponent(), updateDefaultSchema);
builder.append("Java Package:", defaultPackage.getComponent(), updateDefaultPackage);
builder.append("Custom Superclass:", defaultSuperclass.getComponent(), updateDefaultSuperclass);
builder.append("Optimistic Locking:", defaultLockType, updateDefaultLockType);
builder.appendSeparator("Client Class Defaults");
builder.append("Allow Client Entities:", clientSupport, new JPanel());
defaultClientPackageLabel = builder.append("Client Java Package:", defaultClientPackage.getComponent(), updateDefaultClientPackage);
defaultClientSuperclassLabel = builder.append("Custom Superclass:", defaultClientSuperclass.getComponent(), updateDefaultClientSuperclass);
this.setLayout(new BorderLayout());
add(builder.getPanel(), BorderLayout.CENTER);
}
Aggregations