Search in sources :

Example 1 with QueryDisplayListener

use of org.apache.cayenne.modeler.event.QueryDisplayListener in project cayenne by apache.

the class ProcedureQueryView method initController.

private void initController() {
    queryRoot.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent event) {
            QueryDescriptor query = mediator.getCurrentQuery();
            if (query != null) {
                query.setRoot(queryRoot.getModel().getSelectedItem());
                mediator.fireQueryEvent(new QueryEvent(this, query));
            }
        }
    });
    mediator.addQueryDisplayListener(new QueryDisplayListener() {

        public void currentQueryChanged(QueryDisplayEvent e) {
            initFromModel();
        }
    });
}
Also used : QueryDescriptor(org.apache.cayenne.map.QueryDescriptor) ProcedureQueryDescriptor(org.apache.cayenne.map.ProcedureQueryDescriptor) QueryDisplayEvent(org.apache.cayenne.modeler.event.QueryDisplayEvent) ActionListener(java.awt.event.ActionListener) QueryDisplayListener(org.apache.cayenne.modeler.event.QueryDisplayListener) ActionEvent(java.awt.event.ActionEvent) QueryEvent(org.apache.cayenne.configuration.event.QueryEvent)

Example 2 with QueryDisplayListener

use of org.apache.cayenne.modeler.event.QueryDisplayListener in project cayenne by apache.

the class SQLTemplateTabbedView method initController.

private void initController() {
    mediator.addQueryDisplayListener(new QueryDisplayListener() {

        public void currentQueryChanged(QueryDisplayEvent e) {
            initFromModel();
        }
    });
    this.addChangeListener(new ChangeListener() {

        public void stateChanged(ChangeEvent e) {
            lastSelectionIndex = getSelectedIndex();
            updateTabs();
        }
    });
}
Also used : QueryDisplayEvent(org.apache.cayenne.modeler.event.QueryDisplayEvent) ChangeEvent(javax.swing.event.ChangeEvent) QueryDisplayListener(org.apache.cayenne.modeler.event.QueryDisplayListener) ChangeListener(javax.swing.event.ChangeListener)

Example 3 with QueryDisplayListener

use of org.apache.cayenne.modeler.event.QueryDisplayListener in project cayenne by apache.

the class SelectQueryTabbedView method initController.

private void initController() {
    mediator.addQueryDisplayListener(new QueryDisplayListener() {

        public void currentQueryChanged(QueryDisplayEvent e) {
            initFromModel();
        }
    });
    this.addChangeListener(new ChangeListener() {

        public void stateChanged(ChangeEvent e) {
            lastSelectionIndex = getSelectedIndex();
            updateTabs();
        }
    });
}
Also used : QueryDisplayEvent(org.apache.cayenne.modeler.event.QueryDisplayEvent) ChangeEvent(javax.swing.event.ChangeEvent) QueryDisplayListener(org.apache.cayenne.modeler.event.QueryDisplayListener) ChangeListener(javax.swing.event.ChangeListener)

Example 4 with QueryDisplayListener

use of org.apache.cayenne.modeler.event.QueryDisplayListener in project cayenne by apache.

the class EjbqlTabbedView method initController.

private void initController() {
    mediator.addQueryDisplayListener(new QueryDisplayListener() {

        public void currentQueryChanged(QueryDisplayEvent e) {
            initFromModel();
        }
    });
    this.addChangeListener(new ChangeListener() {

        public void stateChanged(ChangeEvent e) {
            lastSelectionIndex = getSelectedIndex();
            updateTabs();
        }
    });
}
Also used : QueryDisplayEvent(org.apache.cayenne.modeler.event.QueryDisplayEvent) ChangeEvent(javax.swing.event.ChangeEvent) QueryDisplayListener(org.apache.cayenne.modeler.event.QueryDisplayListener) ChangeListener(javax.swing.event.ChangeListener)

Aggregations

QueryDisplayEvent (org.apache.cayenne.modeler.event.QueryDisplayEvent)4 QueryDisplayListener (org.apache.cayenne.modeler.event.QueryDisplayListener)4 ChangeEvent (javax.swing.event.ChangeEvent)3 ChangeListener (javax.swing.event.ChangeListener)3 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 QueryEvent (org.apache.cayenne.configuration.event.QueryEvent)1 ProcedureQueryDescriptor (org.apache.cayenne.map.ProcedureQueryDescriptor)1 QueryDescriptor (org.apache.cayenne.map.QueryDescriptor)1