use of org.apache.cayenne.swing.components.JCayenneCheckBox in project cayenne by apache.
the class ObjEntityTab method initView.
private void initView() {
this.setLayout(new BorderLayout());
JToolBar toolBar = new JToolBar();
toolBar.setBorder(BorderFactory.createEmptyBorder());
toolBar.setFloatable(false);
ActionManager actionManager = Application.getInstance().getActionManager();
toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton(1));
toolBar.add(actionManager.getAction(CreateRelationshipAction.class).buildButton(3));
toolBar.addSeparator();
toolBar.add(actionManager.getAction(ObjEntitySyncAction.class).buildButton(1));
toolBar.add(actionManager.getAction(ObjEntityCounterpartAction.class).buildButton(3));
toolBar.addSeparator();
toolBar.add(actionManager.getAction(ShowGraphEntityAction.class).buildButton());
add(toolBar, BorderLayout.NORTH);
// create widgets
name = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setEntityName(text);
}
};
superClassName = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setSuperClassName(text);
}
};
className = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setClassName(text);
}
};
qualifier = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setQualifier(text);
}
};
dbEntityCombo = Application.getWidgetFactory().createComboBox();
superEntityCombo = Application.getWidgetFactory().createComboBox();
AutoCompletion.enable(dbEntityCombo);
AutoCompletion.enable(superEntityCombo);
readOnly = new JCayenneCheckBox();
optimisticLocking = new JCayenneCheckBox();
// borderless clickable button used as a label
tableLabel = new JButton("Table/View:");
tableLabel.setBorderPainted(false);
tableLabel.setHorizontalAlignment(SwingConstants.LEFT);
tableLabel.setFocusPainted(false);
tableLabel.setMargin(new Insets(0, 0, 0, 0));
tableLabel.setBorder(null);
isAbstract = new JCayenneCheckBox();
serverOnly = new JCayenneCheckBox();
comment = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) throws ValidationException {
setComment(text);
}
};
clientClassName = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setClientClassName(text);
}
};
clientSuperClassName = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setClientSuperClassName(text);
}
};
// assemble
FormLayout layout = new FormLayout("right:pref, 3dlu, fill:200dlu", "");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.setDefaultDialogBorder();
builder.appendSeparator("ObjEntity Configuration");
builder.append("ObjEntity Name:", name.getComponent());
builder.append("Inheritance:", superEntityCombo);
builder.append(tableLabel, dbEntityCombo);
isAbstractLabel = builder.append("Abstract class:", isAbstract);
builder.append("Comment:", comment.getComponent());
builder.appendSeparator();
builder.append("Java Class:", className.getComponent());
superclassLabel = builder.append("Superclass:", superClassName.getComponent());
builder.append("Qualifier:", qualifier.getComponent());
builder.append("Read-Only:", readOnly);
builder.append("Optimistic Locking:", optimisticLocking);
clientSeparator = builder.appendSeparator("Java Client");
serverOnlyLabel = builder.append("Not for Client Use:", serverOnly);
clientClassNameLabel = builder.append("Client Java Class:", clientClassName.getComponent());
clientSuperClassNameLabel = builder.append("Client Superclass:", clientSuperClassName.getComponent());
add(builder.getPanel(), BorderLayout.CENTER);
}
use of org.apache.cayenne.swing.components.JCayenneCheckBox 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);
}
Aggregations