Skip to content

Commit

Permalink
Reverse Engineering: return "Reengineer Database Schema" tool menu bu…
Browse files Browse the repository at this point in the history
…tton
  • Loading branch information
MegaPapa committed Mar 30, 2018
1 parent 4aec5a8 commit 061ca8a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
import org.apache.cayenne.modeler.action.ShowLogConsoleAction;
import org.apache.cayenne.modeler.action.UndoAction;
import org.apache.cayenne.modeler.action.ValidateAction;
import org.apache.cayenne.modeler.action.dbimport.ReverseEngineeringToolMenuAction;
import org.apache.cayenne.modeler.dialog.LogConsole;
import org.apache.cayenne.modeler.dialog.welcome.WelcomeScreen;
import org.apache.cayenne.modeler.editor.EditorView;
Expand Down Expand Up @@ -232,6 +233,7 @@ protected void initMenus() {
projectMenu.addSeparator();
projectMenu.add(getAction(RemoveAction.class).buildMenu());

toolMenu.add(getAction(ReverseEngineeringToolMenuAction.class).buildMenu());
toolMenu.add(getAction(InferRelationshipsAction.class).buildMenu());
toolMenu.add(getAction(ImportEOModelAction.class).buildMenu());
toolMenu.addSeparator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.cayenne.modeler.action.dbimport.EditNodeAction;
import org.apache.cayenne.modeler.action.dbimport.MoveImportNodeAction;
import org.apache.cayenne.modeler.action.dbimport.MoveInvertNodeAction;
import org.apache.cayenne.modeler.action.dbimport.ReverseEngineeringToolMenuAction;
import org.apache.cayenne.modeler.graph.action.ShowGraphEntityAction;
import org.apache.cayenne.modeler.util.CayenneAction;
import org.apache.cayenne.project.ConfigurationNodeParentGetter;
Expand Down Expand Up @@ -107,6 +108,7 @@ public DefaultActionManager(@Inject Application application, @Inject Configurati
registerAction(new ObjEntityToSuperEntityAction(application));
registerAction(new ReverseEngineeringAction(application));
registerAction(new InferRelationshipsAction(application));
registerAction(new ReverseEngineeringToolMenuAction(application));
registerAction(new ImportEOModelAction(application));
registerAction(new GenerateDBAction(application));
registerAction(new MigrateAction(application));
Expand Down Expand Up @@ -192,7 +194,8 @@ private void initActions() {
ImportEOModelAction.class.getName(),
GenerateCodeAction.class.getName(),
GenerateDBAction.class.getName(),
PasteAction.class.getName()));
PasteAction.class.getName(),
ReverseEngineeringToolMenuAction.class.getName()));

DATA_NODE_ACTIONS = new HashSet<>(DOMAIN_ACTIONS);
DATA_NODE_ACTIONS.addAll(Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*****************************************************************
* 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.action.dbimport;

import org.apache.cayenne.modeler.Application;
import org.apache.cayenne.modeler.util.CayenneAction;

import javax.swing.JOptionPane;
import java.awt.event.ActionEvent;

/**
* @since 4.1
*/
public class ReverseEngineeringToolMenuAction extends CayenneAction {

private static final String ACTION_NAME = "Reengineer Database Schema";
private static final String DIALOG_TITLE = "Reverse Engineering";

public ReverseEngineeringToolMenuAction(Application application) {
super(ACTION_NAME, application);
}

@Override
public void performAction(ActionEvent e) {
JOptionPane.showMessageDialog(null, "Reverse Engineering was moved to DataMap tabs.\n" +
"You will find new Reverse Engineering in DataMap \u2192 DbImport tab.", DIALOG_TITLE,
JOptionPane.INFORMATION_MESSAGE);
}
}

0 comments on commit 061ca8a

Please sign in to comment.