Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse Engineering: return "Reengineer Database Schema" tool menu button #280

Merged
merged 1 commit into from
Apr 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}