Search in sources :

Example 1 with JCayenneCheckBox

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);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) BorderLayout(java.awt.BorderLayout) DefaultFormBuilder(com.jgoodies.forms.builder.DefaultFormBuilder) TextAdapter(org.apache.cayenne.modeler.util.TextAdapter) JCayenneCheckBox(org.apache.cayenne.swing.components.JCayenneCheckBox) JTextField(javax.swing.JTextField)

Example 2 with JCayenneCheckBox

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);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) Insets(java.awt.Insets) ValidationException(org.apache.cayenne.validation.ValidationException) TextAdapter(org.apache.cayenne.modeler.util.TextAdapter) JButton(javax.swing.JButton) JToolBar(javax.swing.JToolBar) JTextField(javax.swing.JTextField) ActionManager(org.apache.cayenne.modeler.action.ActionManager) BorderLayout(java.awt.BorderLayout) DefaultFormBuilder(com.jgoodies.forms.builder.DefaultFormBuilder) JCayenneCheckBox(org.apache.cayenne.swing.components.JCayenneCheckBox)

Example 3 with JCayenneCheckBox

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);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) PanelBuilder(com.jgoodies.forms.builder.PanelBuilder) BorderLayout(java.awt.BorderLayout) JCayenneCheckBox(org.apache.cayenne.swing.components.JCayenneCheckBox) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 4 with JCayenneCheckBox

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);
}
Also used : BorderLayout(java.awt.BorderLayout) JCayenneCheckBox(org.apache.cayenne.swing.components.JCayenneCheckBox)

Example 5 with JCayenneCheckBox

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);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) PanelBuilder(com.jgoodies.forms.builder.PanelBuilder) ValidatorTextAdapter(org.apache.cayenne.modeler.util.ValidatorTextAdapter) ValidationException(org.apache.cayenne.validation.ValidationException) BorderLayout(java.awt.BorderLayout) ValidatorTextAdapter(org.apache.cayenne.modeler.util.ValidatorTextAdapter) TextAdapter(org.apache.cayenne.modeler.util.TextAdapter) JCayenneCheckBox(org.apache.cayenne.swing.components.JCayenneCheckBox) JTextField(javax.swing.JTextField) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Aggregations

BorderLayout (java.awt.BorderLayout)7 JCayenneCheckBox (org.apache.cayenne.swing.components.JCayenneCheckBox)7 FormLayout (com.jgoodies.forms.layout.FormLayout)6 JTextField (javax.swing.JTextField)5 TextAdapter (org.apache.cayenne.modeler.util.TextAdapter)5 DefaultFormBuilder (com.jgoodies.forms.builder.DefaultFormBuilder)3 PanelBuilder (com.jgoodies.forms.builder.PanelBuilder)3 CellConstraints (com.jgoodies.forms.layout.CellConstraints)3 ValidationException (org.apache.cayenne.validation.ValidationException)3 JButton (javax.swing.JButton)2 Insets (java.awt.Insets)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JToolBar (javax.swing.JToolBar)1 ActionManager (org.apache.cayenne.modeler.action.ActionManager)1 ValidatorTextAdapter (org.apache.cayenne.modeler.util.ValidatorTextAdapter)1