Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
 
 
 package org.apache.cayenne.modeler.editor;
 
 
 
 import  org.apache.cayenne.query.EJBQLQuery;
 import  org.apache.cayenne.query.ProcedureQuery;
 import  org.apache.cayenne.query.Query;
 import  org.apache.cayenne.query.SQLTemplate;
 import  org.apache.cayenne.query.SelectQuery;
Main display area split into the project navigation tree on the left and selected object editor on the right.
 
 public class EditorView extends JPanel implements ObjEntityDisplayListener,
 
     private static final String EMPTY_VIEW = "Empty";
     private static final String DOMAIN_VIEW = "Domain";
     private static final String NODE_VIEW = "Node";
     private static final String DATA_MAP_VIEW = "DataMap";
     private static final String OBJ_VIEW = "ObjView";
     private static final String DB_VIEW = "DbView";
     private static final String EMBEDDABLE_VIEW = "EmbeddableView";
     private static final String PROCEDURE_VIEW = "ProcedureView";
     private static final String SELECT_QUERY_VIEW = "SelectQueryView";
     private static final String SQL_TEMPLATE_VIEW = "SQLTemplateView";
     private static final String PROCEDURE_QUERY_VIEW = "ProcedureQueryView";
     private static final String EJBQL_QUERY_VIEW = "EjbqlQueryView";
 
     protected ProjectController eventController;
     protected JSplitPane splitPane;
     protected Container detailPanel;
     protected CardLayout detailLayout;
     private ProjectTreeView treePanel;
     
     private DbEntityTabbedView dbDetailView;
     private DataMapTabbedView dataMapView;
     private EjbqlTabbedView ejbqlQueryView;
     private JTabbedPane dataNodeView;
    
        return ;
    }
    
        return ;
    }
    
        return ;
    }
        return ;
    }
        return ;
    }
        return ;
    }
    
        return ;
    }
        return ;
    }
    
    public DataMapTabbedView getDataMapView() {
        return ;
    }
    
    public JTabbedPane getDataNodeView() {
        return ;
    }
    public EditorView(ProjectController eventController) {
        this. = eventController;
        initView();
        initController();
    }
    private void initView() {
        // init widgets
         = new ProjectTreeView();
        .setMinimumSize(new Dimension(50, 200));
        this. = new JPanel();
        this. = new JSplitPane(.true);
        // assemble...
        this. = new CardLayout();
        // some but not all panels must be wrapped in a scroll pane
        // those that are not wrapped usually have there own scrollers
        // in subpanels...
        .add(new JPanel(), );
        Component domainView = new DataDomainView();
        .add(new JScrollPane(domainView), );
        DataNodeEditor nodeController = new DataNodeEditor();
        .add(nodeController.getView(), );
        Component dataMapView = new DataMapTabbedView();
        .add(dataMapView);
        Component procedureView = new ProcedureTabbedView();
        .add(procedureView);
        Component selectQueryView = new SelectQueryTabbedView();
        .add(selectQueryView);
        Component sqlTemplateView = new SQLTemplateTabbedView();
        .add(sqlTemplateView);
        Component procedureQueryView = new ProcedureQueryView();
        .add(new JScrollPane(procedureQueryView), );
        Component ejbqlQueryView = new EjbqlTabbedView();
        .add(ejbqlQueryView);
        setLayout(new BorderLayout());
        add(.);
    }
    private void initController() {
        .addEmbeddableDisplayListener(this);

        
Moving this to try-catch block per CAY-940. Exception will be stack-traced
        try {
            Domain domain = 
                    .getApplicationPreferenceDomain()
                    .getSubdomain(this.getClass());
            ComponentGeometry geometry = (ComponentGeometrydomain.getDetail(
                    "splitPane.divider",
                    ComponentGeometry.class,
                    true);
            geometry
                    .bindIntProperty(., 150);
        }
        catch (Exception ex) {
            LogFactory.getLog(getClass()).error("Cannot bind divider property"ex);
        }
    }
        if (e.getProcedure() == null)
            .show();
        else
            .show();
    }
    public void currentDomainChanged(DomainDisplayEvent e) {
        if (e.getDomain() == null)
            .show();
        else
            .show();
    }
    public void currentDataNodeChanged(DataNodeDisplayEvent e) {
        if (e.getDataNode() == null)
            .show();
        else
            .show();
    }
    public void currentDataMapChanged(DataMapDisplayEvent e) {
        if (e.getDataMap() == null)
            .show();
        else
            .show();
    }
    public void currentObjEntityChanged(EntityDisplayEvent e) {
        if (e.getEntity() == null)
            .show();
        else
            .show();
    }
    public void currentDbEntityChanged(EntityDisplayEvent e) {
        if (e.getEntity() == null)
            .show();
        else
            .show();
    }
    public void currentQueryChanged(QueryDisplayEvent e) {
        Query query = e.getQuery();
        if (query instanceof SelectQuery) {
        }
        else if (query instanceof SQLTemplate) {
        }
        else if (query instanceof ProcedureQuery) {
        }
        else if (query instanceof EJBQLQuery) {
            .show();
        }
        else {
            .show();
        }
    }
    }
        if (e.getEmbeddable() == null)
            .show();
        else
            .show();
    }
New to GrepCode? Check out our FAQ X