Search in sources :

Example 1 with ReverseEngineeringAction

use of org.apache.cayenne.modeler.action.ReverseEngineeringAction in project cayenne by apache.

the class DbImportTabController method runGenerators.

@Override
public void runGenerators(Set<DataMap> dataMaps) {
    if (dataMaps.isEmpty()) {
        view.showEmptyMessage();
        return;
    }
    Application.getInstance().getFrameController().getDbImportController().setGlobalImport(true);
    ReverseEngineeringAction reverseEngineeringAction = Application.getInstance().getActionManager().getAction(ReverseEngineeringAction.class);
    reverseEngineeringAction.performAction(dataMaps);
}
Also used : ReverseEngineeringAction(org.apache.cayenne.modeler.action.ReverseEngineeringAction)

Example 2 with ReverseEngineeringAction

use of org.apache.cayenne.modeler.action.ReverseEngineeringAction in project cayenne by apache.

the class DbImportView method buildForm.

private void buildForm() {
    FormLayout buttonPanelLayout = new FormLayout(BUTTON_PANEL_LAYOUT);
    DefaultFormBuilder buttonBuilder = new DefaultFormBuilder(buttonPanelLayout);
    buttonBuilder.append(draggableTreePanel.getMoveButton());
    buttonBuilder.append(draggableTreePanel.getMoveInvertButton());
    FormLayout layout = new FormLayout(MAIN_LAYOUT);
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.append(treeToolbar, ALL_LINE_SPAN);
    FormLayout headerLayout = new FormLayout(HEADER_LAYOUT);
    DefaultFormBuilder reverseEngineeringHeaderBuilder = new DefaultFormBuilder(headerLayout);
    JLabel importLabel = new JLabel("Database Import Configuration");
    importLabel.setBorder(new EmptyBorder(0, 5, 0, 0));
    reverseEngineeringHeaderBuilder.append(importLabel);
    builder.append(reverseEngineeringHeaderBuilder.getPanel());
    DefaultFormBuilder databaseHeaderBuilder = new DefaultFormBuilder(headerLayout);
    JLabel schemaLabel = new JLabel("Database Schema");
    schemaLabel.setBorder(new EmptyBorder(0, 5, 0, 0));
    databaseHeaderBuilder.append(schemaLabel);
    LoadDbSchemaAction loadDbSchemaAction = projectController.getApplication().getActionManager().getAction(LoadDbSchemaAction.class);
    loadDbSchemaAction.setDraggableTreePanel(draggableTreePanel);
    loadDbSchemaButton = (CayenneAction.CayenneToolbarButton) loadDbSchemaAction.buildButton(0);
    loadDbSchemaButton.setShowingText(false);
    loadDbSchemaButton.setText("Refresh DB Schema");
    treeToolbar.add(loadDbSchemaButton);
    ReverseEngineeringAction reverseEngineeringAction = projectController.getApplication().getActionManager().getAction(ReverseEngineeringAction.class);
    reverseEngineeringAction.setView(this);
    CayenneAction.CayenneToolbarButton reverseEngineeringButton = (CayenneAction.CayenneToolbarButton) reverseEngineeringAction.buildButton(0);
    reverseEngineeringButton.setShowingText(true);
    reverseEngineeringButton.setText("Run Import");
    JPanel reverseEngineeringButtonPanel = new JPanel();
    reverseEngineeringButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    reverseEngineeringButtonPanel.add(reverseEngineeringButton);
    treeToolbar.addSeparator();
    treeToolbar.add(reverseEngineeringButtonPanel);
    builder.append("");
    builder.append(databaseHeaderBuilder.getPanel());
    builder.append(treePanel);
    builder.append(buttonBuilder.getPanel());
    builder.append(draggableTreePanel);
    loadDbSchemaProgress = new JProgressBar();
    reverseEngineeringProgress = new JProgressBar();
    loadDbSchemaProgress.setIndeterminate(true);
    loadDbSchemaProgress.setVisible(false);
    reverseEngineeringProgress.setIndeterminate(true);
    reverseEngineeringProgress.setVisible(false);
    FormLayout progressLayout = new FormLayout(PROGRESS_PANEL_LAYOUT, "fill:10dlu");
    DefaultFormBuilder progressBarBuilder = new DefaultFormBuilder(progressLayout);
    progressBarBuilder.append(reverseEngineeringProgress);
    progressBarBuilder.append(loadDbSchemaProgress);
    builder.append(progressBarBuilder.getPanel(), ALL_LINE_SPAN);
    createAdvancedOptionsHiderPanel(builder);
    builder.append(configPanel, ALL_LINE_SPAN);
    this.setLayout(new BorderLayout());
    add(builder.getPanel(), BorderLayout.CENTER);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) LoadDbSchemaAction(org.apache.cayenne.modeler.action.LoadDbSchemaAction) JProgressBar(javax.swing.JProgressBar) JLabel(javax.swing.JLabel) CayenneAction(org.apache.cayenne.modeler.util.CayenneAction) ReverseEngineeringAction(org.apache.cayenne.modeler.action.ReverseEngineeringAction) BorderLayout(java.awt.BorderLayout) DefaultFormBuilder(com.jgoodies.forms.builder.DefaultFormBuilder) EmptyBorder(javax.swing.border.EmptyBorder)

Aggregations

ReverseEngineeringAction (org.apache.cayenne.modeler.action.ReverseEngineeringAction)2 DefaultFormBuilder (com.jgoodies.forms.builder.DefaultFormBuilder)1 FormLayout (com.jgoodies.forms.layout.FormLayout)1 BorderLayout (java.awt.BorderLayout)1 FlowLayout (java.awt.FlowLayout)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JProgressBar (javax.swing.JProgressBar)1 EmptyBorder (javax.swing.border.EmptyBorder)1 LoadDbSchemaAction (org.apache.cayenne.modeler.action.LoadDbSchemaAction)1 CayenneAction (org.apache.cayenne.modeler.util.CayenneAction)1