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);
}
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);
}
Aggregations