use of org.apache.cayenne.swing.components.JCayenneCheckBox in project cayenne by apache.
the class ProcedureTab method initView.
private void initView() {
// create widgets
this.name = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setProcedureName(text);
}
};
this.schema = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setSchema(text);
}
};
this.catalog = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setCatalog(text);
}
};
this.comment = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setComment(text);
}
};
this.returnsValue = new JCayenneCheckBox();
this.returnsValue.setToolTipText("first parameter will be used as return value");
FormLayout layout = new FormLayout("right:pref, 3dlu, fill:200dlu", "");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.setDefaultDialogBorder();
builder.appendSeparator("Stored Procedure Configuration");
builder.append("Procedure Name:", name.getComponent());
builder.append("Catalog:", catalog.getComponent());
builder.append("Schema:", schema.getComponent());
builder.append("Returns Value:", returnsValue);
builder.append("Comment:", comment.getComponent());
this.setLayout(new BorderLayout());
this.add(builder.getPanel(), BorderLayout.CENTER);
}
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 ObjectQueryPropertiesPanel method initView.
protected void initView() {
super.initView();
// create widgets
dataRows = new JCayenneCheckBox();
// assemble
CellConstraints cc = new CellConstraints();
FormLayout layout = new FormLayout("right:max(80dlu;pref), 3dlu, left:max(50dlu;pref), fill:max(150dlu;pref)", "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p");
PanelBuilder builder = new PanelBuilder(layout);
builder.setDefaultDialogBorder();
builder.addSeparator("", cc.xywh(1, 1, 4, 1));
builder.addLabel("Result Caching:", cc.xy(1, 3));
builder.add(cacheStrategy, cc.xywh(3, 3, 2, 1));
cacheGroupsLabel = builder.addLabel("Cache Group:", cc.xy(1, 7));
builder.add(cacheGroups.getComponent(), cc.xywh(3, 7, 2, 1));
builder.addLabel("Fetch Data Rows:", cc.xy(1, 9));
builder.add(dataRows, cc.xy(3, 9));
builder.addLabel("Fetch Offset, Rows:", cc.xy(1, 11));
builder.add(fetchOffset.getComponent(), cc.xy(3, 11));
builder.addLabel("Fetch Limit, Rows:", cc.xy(1, 13));
builder.add(fetchLimit.getComponent(), cc.xy(3, 13));
builder.addLabel("Page Size:", cc.xy(1, 15));
builder.add(pageSize.getComponent(), cc.xy(3, 15));
this.setLayout(new BorderLayout());
this.add(builder.getPanel(), BorderLayout.CENTER);
}
use of org.apache.cayenne.swing.components.JCayenneCheckBox in project cayenne by apache.
the class RawQueryPropertiesPanel method initView.
protected void initView() {
super.initView();
// create widgets
dataObjects = new JCayenneCheckBox();
entities = Application.getWidgetFactory().createUndoableComboBox();
entities.setRenderer(CellRenderers.listRendererWithIcons());
this.setLayout(new BorderLayout());
this.add(createPanelBuilder().getPanel(), BorderLayout.CENTER);
}
use of org.apache.cayenne.swing.components.JCayenneCheckBox in project cayenne by apache.
the class SelectQueryMainTab method initView.
private void initView() {
// create widgets
name = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setQueryName(text);
}
};
qualifier = new ValidatorTextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setQueryQualifier(text);
}
@Override
protected void validate(String text) throws ValidationException {
createQualifier(text);
}
};
comment = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setQueryComment(text);
}
};
distinct = new JCayenneCheckBox();
properties = new ObjectQueryPropertiesPanel(mediator);
// assemble
CellConstraints cc = new CellConstraints();
FormLayout layout = new FormLayout("right:max(80dlu;pref), 3dlu, fill:200dlu", "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p");
PanelBuilder builder = new PanelBuilder(layout);
builder.setDefaultDialogBorder();
builder.addSeparator("SelectQuery Settings", cc.xywh(1, 1, 3, 1));
builder.addLabel("Query Name:", cc.xy(1, 3));
builder.add(name.getComponent(), cc.xy(3, 3));
builder.addLabel("Query Root:", cc.xy(1, 5));
builder.add(queryRoot, cc.xy(3, 5));
builder.addLabel("Qualifier:", cc.xy(1, 7));
builder.add(qualifier.getComponent(), cc.xy(3, 7));
builder.addLabel("Distinct:", cc.xy(1, 9));
builder.add(distinct, cc.xy(3, 9));
builder.addLabel("Comment:", cc.xy(1, 11));
builder.add(comment.getComponent(), cc.xy(3, 11));
this.setLayout(new BorderLayout());
this.add(builder.getPanel(), BorderLayout.NORTH);
this.add(properties, BorderLayout.CENTER);
}
Aggregations