http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorController.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorController.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorController.java deleted file mode 100644 index a5ac549..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorController.java +++ /dev/null @@ -1,169 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import org.apache.cayenne.gen.ClassGenerationAction; -//import org.apache.cayenne.map.DataMap; -//import org.apache.cayenne.modeler.dialog.ErrorDebugDialog; -//import org.apache.cayenne.modeler.util.CayenneController; -//import org.apache.cayenne.swing.BindingBuilder; -//import org.slf4j.Logger; -//import org.slf4j.LoggerFactory; -// -//import javax.swing.JOptionPane; -//import java.awt.Component; -//import java.util.Collection; -//import java.util.function.Predicate; -// -///** -// * A controller for the class generator dialog. -// */ -//public class CodeGeneratorController extends CodeGeneratorControllerBase { -// /** -// * Logger to print stack traces -// */ -// private static Logger logObj = LoggerFactory.getLogger(ErrorDebugDialog.class); -// -// protected CodeGeneratorDialog view; -// -// protected ClassesTabController classesSelector; -// protected GeneratorTabController generatorSelector; -// -// public CodeGeneratorController(CayenneController parent, Collection<DataMap> dataMaps) { -// super(parent, dataMaps); -// -// this.classesSelector = new ClassesTabController(this, dataMaps); -// this.generatorSelector = new GeneratorTabController(this); -// } -// -// @Override -// public Component getView() { -// return view; -// } -// -// public void startup() { -// // show dialog even on empty DataMap, as custom generation may still take -// // advantage of it -// -// view = new CodeGeneratorDialog(generatorSelector.getView(), classesSelector.getView()); -// initBindings(); -// -// view.pack(); -// view.setModal(true); -// centerView(); -// makeCloseableOnEscape(); -// view.setVisible(true); -// } -// -// protected void initBindings() { -// BindingBuilder builder = new BindingBuilder( -// getApplication().getBindingFactory(), -// this); -// -// builder.bindToAction(view.getCancelButton(), "cancelAction()"); -// builder.bindToAction(view.getGenerateButton(), "generateAction()"); -// builder.bindToAction(this, "classesSelectedAction()", SELECTED_PROPERTY); -// builder.bindToAction(generatorSelector, "generatorSelectedAction()", -// GeneratorTabController.GENERATOR_PROPERTY); -// -// generatorSelectedAction(); -// } -// -// public void generatorSelectedAction() { -// GeneratorController controller = generatorSelector.getGeneratorController(); -// validate(controller); -// -// Predicate<Object> predicate = controller != null -// ? controller.getDefaultClassFilter() -// : o -> false; -// -// updateSelection(predicate); -// classesSelector.classSelectedAction(); -// } -// -// public void classesSelectedAction() { -// int size = getSelectedEntitiesSize(); -// String label; -// -// if (size == 0) { -// label = "No entities selected"; -// } -// else if (size == 1) { -// label = "One entity selected"; -// } -// else { -// label = size + " entities selected"; -// } -// -// label = label.concat("; "); -// -// int sizeEmb = getSelectedEmbeddablesSize(); -// -// if (sizeEmb == 0) { -// label = label + "No embeddables selected"; -// } -// else if (sizeEmb == 1) { -// label = label + "One embeddable selected"; -// } -// else { -// label = label + sizeEmb + " embeddables selected"; -// } -// -// label = label.concat("; "); -// -// int sizeDataMap = getSelectedDataMapsSize(); -// -// if(sizeDataMap == 0) { -// label = label + "No datamaps selected"; -// } else if(sizeDataMap == 1) { -// label = label + "One datamap selected"; -// } else { -// label = label + sizeDataMap + " datamaps selected"; -// } -// -// view.getClassesCount().setText(label); -// } -// -// public void cancelAction() { -// view.dispose(); -// } -// -// public void generateAction() { -// Collection<ClassGenerationAction> generators = generatorSelector.getConfiguration(); -// -// if (generators != null) { -// try { -// for (ClassGenerationAction generator : generators) { -// generator.execute(); -// } -// JOptionPane.showMessageDialog( -// this.getView(), -// "Class generation finished"); -// } catch (Exception e) { -// logObj.error("Error generating classes", e); -// JOptionPane.showMessageDialog( -// this.getView(), -// "Error generating classes - " + e.getMessage()); -// } -// } -// -// view.dispose(); -// } -//} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorControllerBase.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorControllerBase.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorControllerBase.java deleted file mode 100644 index 3848126..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorControllerBase.java +++ /dev/null @@ -1,380 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import org.apache.cayenne.map.DataMap; -//import org.apache.cayenne.map.Embeddable; -//import org.apache.cayenne.map.ObjEntity; -//import org.apache.cayenne.modeler.util.CayenneController; -//import org.apache.cayenne.modeler.util.CellRenderers; -//import org.apache.cayenne.validation.ValidationFailure; -//import org.apache.cayenne.validation.ValidationResult; -// -//import javax.swing.Icon; -//import javax.swing.JLabel; -//import java.awt.Component; -//import java.util.ArrayList; -//import java.util.Collection; -//import java.util.HashSet; -//import java.util.List; -//import java.util.Set; -//import java.util.function.Predicate; -// -///** -// * A base superclass of a top controller for the code generator. Defines all common model -// * parts used in class generation. -// * -// */ -//public abstract class CodeGeneratorControllerBase extends CayenneController { -// -// public static final String SELECTED_PROPERTY = "selected"; -// -// protected Collection<DataMap> dataMaps; -// -// protected ValidationResult validation; -// -// protected List<Object> classes; -// -// private Set<String> selectedEntities; -// private Set<String> selectedEmbeddables; -// private Set<String> selectedDataMaps; -// -// private transient Object currentClass; -// -// public CodeGeneratorControllerBase(CayenneController parent, Collection<DataMap> dataMaps) { -// super(parent); -// -// this.dataMaps = dataMaps; -// this.classes = new ArrayList<>(); -// -// for(DataMap dataMap:dataMaps){ -// this.classes.addAll(dataMap.getObjEntities()); -// this.classes.addAll(dataMap.getEmbeddables()); -// this.classes.add(dataMap); -// } -// this.selectedEntities = new HashSet<>(); -// this.selectedEmbeddables = new HashSet<>(); -// this.selectedDataMaps = new HashSet<>(); -// } -// -// public List<Object> getClasses() { -// return classes; -// } -// -// public abstract Component getView(); -// -// public void validate(GeneratorController validator) { -// -// ValidationResult validationBuffer = new ValidationResult(); -// -// if (validator != null) { -// for (Object classObj : classes) { -// if (classObj instanceof ObjEntity) { -// validator.validateEntity( -// validationBuffer, -// (ObjEntity) classObj, -// false); -// } -// else if (classObj instanceof Embeddable) { -// validator.validateEmbeddable(validationBuffer, (Embeddable) classObj); -// } -// } -// -// } -// -// this.validation = validationBuffer; -// } -// -// public boolean updateSelection(Predicate<Object> predicate) { -// -// boolean modified = false; -// -// for (Object classObj : classes) { -// boolean select = predicate.test(classObj); -// if (classObj instanceof ObjEntity) { -// -// if (select) { -// if (selectedEntities.add(((ObjEntity) classObj).getName())) { -// modified = true; -// } -// } -// else { -// if (selectedEntities.remove(((ObjEntity) classObj).getName())) { -// modified = true; -// } -// } -// } -// else if (classObj instanceof Embeddable) { -// if (select) { -// if (selectedEmbeddables.add(((Embeddable) classObj).getClassName())) { -// modified = true; -// } -// } -// else { -// if (selectedEmbeddables -// .remove(((Embeddable) classObj).getClassName())) { -// modified = true; -// } -// } -// } else if(classObj instanceof DataMap) { -// if(select) { -// if(selectedDataMaps.add(((DataMap) classObj).getName())) { -// modified = true; -// } -// } else { -// if(selectedDataMaps.remove(((DataMap) classObj).getName())) { -// modified = true; -// } -// } -// } -// -// } -// -// if (modified) { -// firePropertyChange(SELECTED_PROPERTY, null, null); -// } -// -// return modified; -// } -// -// public boolean updateDataMapSelection(Predicate<Object> predicate, DataMap dataMap) { -// -// boolean modified = false; -// -// for (Object classObj : classes) { -// boolean select = predicate.test(classObj); -// if (classObj instanceof ObjEntity) { -// if(dataMap.getObjEntities().contains(classObj)) { -// if (select) { -// if (selectedEntities.add(((ObjEntity) classObj).getName())) { -// modified = true; -// } -// } else { -// if (selectedEntities.remove(((ObjEntity) classObj).getName())) { -// modified = true; -// } -// } -// } -// } -// else if (classObj instanceof Embeddable) { -// if(dataMap.getEmbeddables().contains(classObj)) { -// if (select) { -// if (selectedEmbeddables.add(((Embeddable) classObj).getClassName())) { -// modified = true; -// } -// } else { -// if (selectedEmbeddables -// .remove(((Embeddable) classObj).getClassName())) { -// modified = true; -// } -// } -// } -// } else { -// if(dataMap == classObj) { -// if (select) { -// if (selectedDataMaps.add(((DataMap) classObj).getName())) { -// modified = true; -// } -// } else { -// if (selectedDataMaps.remove(((DataMap) classObj).getName())) { -// modified = true; -// } -// } -// } -// } -// -// } -// -// if (modified) { -// firePropertyChange(SELECTED_PROPERTY, null, null); -// } -// -// return modified; -// } -// -// public List<Embeddable> getSelectedEmbeddables() { -// -// List<Embeddable> selected = new ArrayList<>(selectedEmbeddables.size()); -// -// for (Object classObj : classes) { -// if (classObj instanceof Embeddable -// && selectedEmbeddables.contains(((Embeddable) classObj) -// .getClassName())) { -// selected.add((Embeddable) classObj); -// } -// } -// -// return selected; -// } -// -// public List<ObjEntity> getSelectedEntities() { -// List<ObjEntity> selected = new ArrayList<>(selectedEntities.size()); -// for (Object classObj : classes) { -// if (classObj instanceof ObjEntity -// && selectedEntities.contains(((ObjEntity) classObj).getName())) { -// selected.add(((ObjEntity) classObj)); -// } -// } -// -// return selected; -// } -// -// public List<DataMap> getSelectedDataMaps() { -// List<DataMap> selected = new ArrayList<>(selectedDataMaps.size()); -// for(Object classObj : classes) { -// if(classObj instanceof DataMap -// && selectedDataMaps.contains(((DataMap) classObj).getName())) { -// selected.add((DataMap) classObj); -// } -// } -// return selected; -// } -// -// public int getSelectedEntitiesSize() { -// return selectedEntities.size(); -// } -// -// public int getSelectedEmbeddablesSize() { -// return selectedEmbeddables.size(); -// } -// -// public int getSelectedDataMapsSize() { -// return selectedDataMaps.size(); -// } -// -// /** -// * Returns the first encountered validation problem for an antity matching the name or -// * null if the entity is valid or the entity is not present. -// */ -// public String getProblem(Object obj) { -// -// String name = null; -// -// if (obj instanceof ObjEntity) { -// name = ((ObjEntity) obj).getName(); -// } -// else if (obj instanceof Embeddable) { -// name = ((Embeddable) obj).getClassName(); -// } -// -// if (validation == null) { -// return null; -// } -// -// List failures = validation.getFailures(name); -// if (failures.isEmpty()) { -// return null; -// } -// -// return ((ValidationFailure) failures.get(0)).getDescription(); -// } -// -// public boolean isSelected() { -// if (currentClass instanceof ObjEntity) { -// return selectedEntities -// .contains(((ObjEntity) currentClass).getName()); -// } -// if (currentClass instanceof Embeddable) { -// return selectedEmbeddables -// .contains(((Embeddable) currentClass).getClassName()); -// } -// if(currentClass instanceof DataMap) { -// return selectedDataMaps -// .contains(((DataMap) currentClass).getName()); -// } -// return false; -// -// } -// -// public void setSelected(boolean selectedFlag) { -// if (currentClass == null) { -// return; -// } -// if (currentClass instanceof ObjEntity) { -// if (selectedFlag) { -// if (selectedEntities.add(((ObjEntity) currentClass).getName())) { -// firePropertyChange(SELECTED_PROPERTY, null, null); -// } -// } -// else { -// if (selectedEntities.remove(((ObjEntity) currentClass).getName())) { -// firePropertyChange(SELECTED_PROPERTY, null, null); -// } -// } -// } -// if (currentClass instanceof Embeddable) { -// if (selectedFlag) { -// if (selectedEmbeddables.add(((Embeddable) currentClass).getClassName())) { -// firePropertyChange(SELECTED_PROPERTY, null, null); -// } -// } -// else { -// if (selectedEmbeddables -// .remove(((Embeddable) currentClass).getClassName())) { -// firePropertyChange(SELECTED_PROPERTY, null, null); -// } -// } -// } -// if(currentClass instanceof DataMap) { -// if(selectedFlag) { -// if(selectedDataMaps.add(((DataMap) currentClass).getName())) { -// firePropertyChange(SELECTED_PROPERTY, null, null); -// } -// } else { -// if(selectedDataMaps.remove(((DataMap) currentClass).getName())) { -// firePropertyChange(SELECTED_PROPERTY, null, null); -// } -// } -// } -// } -// -// public Object getCurrentClass() { -// return currentClass; -// } -// -// public void setCurrentClass(Object currentClass) { -// this.currentClass = currentClass; -// } -// -// public Collection<DataMap> getDataMaps() { -// return dataMaps; -// } -// -// public JLabel getItemName(Object obj) { -// String className; -// Icon icon; -// if (obj instanceof Embeddable) { -// className = ((Embeddable) obj).getClassName(); -// icon = CellRenderers.iconForObject(new Embeddable()); -// } else if(obj instanceof ObjEntity) { -// className = ((ObjEntity) obj).getName(); -// icon = CellRenderers.iconForObject(new ObjEntity()); -// } else { -// className = ((DataMap) obj).getName(); -// icon = CellRenderers.iconForObject(new DataMap()); -// } -// JLabel labelIcon = new JLabel(); -// labelIcon.setIcon(icon); -// labelIcon.setVisible(true); -// labelIcon.setText(className); -// return labelIcon; -// } -// -//} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorDialog.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorDialog.java deleted file mode 100644 index c4f4bd1..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorDialog.java +++ /dev/null @@ -1,99 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import org.apache.cayenne.modeler.Application; -//import org.apache.cayenne.swing.components.TopBorder; -// -//import javax.swing.Box; -//import javax.swing.JButton; -//import javax.swing.JDialog; -//import javax.swing.JLabel; -//import javax.swing.JPanel; -//import javax.swing.JScrollPane; -//import javax.swing.JSplitPane; -//import javax.swing.ScrollPaneConstants; -//import java.awt.BorderLayout; -//import java.awt.Component; -//import java.awt.Container; -//import java.awt.Dimension; -//import java.awt.FlowLayout; -// -///** -// */ -//public class CodeGeneratorDialog extends JDialog { -// -// private JButton generateButton; -// protected JButton cancelButton; -// private JLabel classesCount; -// -// CodeGeneratorDialog(Component generatorPanel, Component entitySelectorPanel) { -// super(Application.getFrame()); -// -// JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); -// splitPane.setFocusable(false); -// -// this.generateButton = new JButton("Generate"); -// getRootPane().setDefaultButton(generateButton); -// -// this.cancelButton = new JButton("Cancel"); -// this.classesCount = new JLabel("No classes selected"); -// classesCount.setFont(classesCount.getFont().deriveFont(10f)); -// -// -// JScrollPane scrollPane = new JScrollPane( -// generatorPanel, -// ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, -// ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); -// scrollPane.setPreferredSize(new Dimension(630, 500)); -// -// splitPane.setLeftComponent(entitySelectorPanel); -// splitPane.setRightComponent(scrollPane); -// -// JPanel messages = new JPanel(new BorderLayout()); -// messages.add(classesCount, BorderLayout.WEST); -// -// JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT)); -// buttons.setBorder(TopBorder.create()); -// buttons.add(classesCount); -// buttons.add(Box.createHorizontalStrut(50)); -// buttons.add(cancelButton); -// buttons.add(generateButton); -// -// Container contentPane = getContentPane(); -// contentPane.setLayout(new BorderLayout()); -// contentPane.add(splitPane, BorderLayout.CENTER); -// contentPane.add(buttons, BorderLayout.SOUTH); -// -// setTitle("Code Generation"); -// } -// -// public JButton getCancelButton() { -// return cancelButton; -// } -// -// public JButton getGenerateButton() { -// return generateButton; -// } -// -// public JLabel getClassesCount() { -// return classesCount; -// } -//} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModeController.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModeController.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModeController.java deleted file mode 100644 index 344bd72..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModeController.java +++ /dev/null @@ -1,235 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import org.apache.cayenne.gen.ClassGenerationAction; -//import org.apache.cayenne.map.DataMap; -//import org.apache.cayenne.modeler.CodeTemplateManager; -//import org.apache.cayenne.modeler.dialog.pref.PreferenceDialog; -//import org.apache.cayenne.modeler.pref.DataMapDefaults; -//import org.apache.cayenne.swing.BindingBuilder; -//import org.apache.cayenne.swing.ObjectBinding; -//import org.apache.cayenne.util.Util; -// -//import javax.swing.DefaultComboBoxModel; -//import javax.swing.JCheckBox; -//import javax.swing.JComboBox; -//import java.awt.Component; -//import java.util.List; -//import java.util.ArrayList; -//import java.util.Collection; -//import java.util.Collections; -//import java.util.Map.Entry; -//import java.util.Objects; -//import java.util.Set; -//import java.util.TreeMap; -// -//import static org.apache.cayenne.modeler.CodeTemplateManager.SINGLE_SERVER_CLASS; -//import static org.apache.cayenne.modeler.CodeTemplateManager.STANDARD_SERVER_SUBCLASS; -//import static org.apache.cayenne.modeler.CodeTemplateManager.STANDARD_SERVER_SUPERCLASS; -//import static org.apache.cayenne.modeler.dialog.pref.PreferenceDialog.TEMPLATES_KEY; -// -///** -// * A controller for the custom generation mode. -// */ -//public class CustomModeController extends GeneratorController { -// -// // correspond to non-public constants on MapClassGenerator. -// private static final String MODE_ENTITY = "entity"; -// -// protected CustomModePanel view; -// private CodeTemplateManager templateManager; -// -// private ObjectBinding superTemplate; -// private ObjectBinding subTemplate; -// -// private CustomPreferencesUpdater preferencesUpdater; -// -// public CustomPreferencesUpdater getCustomPreferencesUpdater() { -// return preferencesUpdater; -// } -// -// public CustomModeController(CodeGeneratorControllerBase parent) { -// super(parent); -// -// // bind preferences and init defaults... -// -// Set<Entry<DataMap, DataMapDefaults>> entities = getMapPreferences().entrySet(); -// -// for (Entry<DataMap, DataMapDefaults> entry : entities) { -// -// if (Util.isEmptyString(entry.getValue().getSuperclassTemplate())) { -// entry.getValue().setSuperclassTemplate(STANDARD_SERVER_SUPERCLASS); -// } -// -// if (Util.isEmptyString(entry.getValue().getSubclassTemplate())) { -// entry.getValue().setSubclassTemplate(STANDARD_SERVER_SUBCLASS); -// } -// -// if (Util.isEmptyString(entry.getValue().getProperty("mode"))) { -// entry.getValue().setProperty("mode", MODE_ENTITY); -// } -// -// if (Util.isEmptyString(entry.getValue().getProperty("overwrite"))) { -// entry.getValue().setBooleanProperty("overwrite", false); -// } -// -// if (Util.isEmptyString(entry.getValue().getProperty("pairs"))) { -// entry.getValue().setBooleanProperty("pairs", true); -// } -// -// if (Util.isEmptyString(entry.getValue().getProperty("usePackagePath"))) { -// entry.getValue().setBooleanProperty("usePackagePath", true); -// } -// -// if (Util.isEmptyString(entry.getValue().getProperty("outputPattern"))) { -// entry.getValue().setProperty("outputPattern", "*.java"); -// } -// } -// -// BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this); -// -// builder.bindToAction(view.getManageTemplatesLink(), "popPreferencesAction()"); -// -// builder.bindToStateChange(view.getOverwrite(), "customPreferencesUpdater.overwrite").updateView(); -// -// builder.bindToStateChange(view.getPairs(), "customPreferencesUpdater.pairs").updateView(); -// -// builder.bindToStateChange(view.getUsePackagePath(), "customPreferencesUpdater.usePackagePath").updateView(); -// -// subTemplate = builder.bindToComboSelection(view.getSubclassTemplate(), -// "customPreferencesUpdater.subclassTemplate"); -// -// superTemplate = builder.bindToComboSelection(view.getSuperclassTemplate(), -// "customPreferencesUpdater.superclassTemplate"); -// -// builder.bindToTextField(view.getOutputPattern(), "customPreferencesUpdater.outputPattern").updateView(); -// -// builder.bindToStateChange(view.getCreatePropertyNames(), "customPreferencesUpdater.createPropertyNames") -// .updateView(); -// -// builder.bindToStateChange(view.getCreatePKProperties(), "customPreferencesUpdater.createPKProperties") -// .updateView(); -// -// updateTemplates(); -// } -// -// protected void createDefaults() { -// TreeMap<DataMap, DataMapDefaults> map = new TreeMap<DataMap, DataMapDefaults>(); -// Collection<DataMap> dataMaps = getParentController().getDataMaps(); -// for (DataMap dataMap : dataMaps) { -// DataMapDefaults preferences; -// preferences = getApplication().getFrameController().getProjectController() -// .getDataMapPreferences(this.getClass().getName().replace(".", "/"), dataMap); -// preferences.setSuperclassPackage(""); -// preferences.updateSuperclassPackage(dataMap, false); -// -// map.put(dataMap, preferences); -// -// if (getOutputPath() == null) { -// setOutputPath(preferences.getOutputPath()); -// } -// } -// -// setMapPreferences(map); -// preferencesUpdater = new CustomPreferencesUpdater(map); -// } -// -// protected GeneratorControllerPanel createView() { -// this.view = new CustomModePanel(); -// return view; -// } -// -// private void updateTemplates() { -// this.templateManager = getApplication().getCodeTemplateManager(); -// -// List<String> customTemplates = new ArrayList<>(templateManager.getCustomTemplates().keySet()); -// Collections.sort(customTemplates); -// -// List<String> superTemplates = new ArrayList<>(templateManager.getStandardSuperclassTemplates()); -// Collections.sort(superTemplates); -// superTemplates.addAll(customTemplates); -// -// List<String> subTemplates = new ArrayList<>(templateManager.getStandardSubclassTemplates()); -// Collections.sort(subTemplates); -// subTemplates.addAll(customTemplates); -// -// this.view.getSubclassTemplate().setModel(new DefaultComboBoxModel<>(subTemplates.toArray(new String[0]))); -// this.view.getSuperclassTemplate().setModel(new DefaultComboBoxModel<>(superTemplates.toArray(new String[0]))); -// -// JCheckBox pairs = this.view.getPairs(); -// updateView(); -// pairs.addItemListener(e -> updateView()); -// -// superTemplate.updateView(); -// subTemplate.updateView(); -// } -// -// private void updateView() { -// boolean selected = view.getPairs().isSelected(); -// JComboBox<String> subclassTemplate = view.getSubclassTemplate(); -// subclassTemplate.setSelectedItem(selected ? STANDARD_SERVER_SUBCLASS : SINGLE_SERVER_CLASS); -// view.getSuperclassTemplate().setEnabled(selected); -// view.getOverwrite().setEnabled(!selected); -// } -// -// public Component getView() { -// return view; -// } -// -// public Collection<ClassGenerationAction> createConfiguration() { -// -// Collection<ClassGenerationAction> generators = super.createConfiguration(); -// -// String superKey = Objects.requireNonNull(view.getSuperclassTemplate().getSelectedItem()).toString(); -// String superTemplate = templateManager.getTemplatePath(superKey); -// -// String subKey = Objects.requireNonNull(view.getSubclassTemplate().getSelectedItem()).toString(); -// String subTemplate = templateManager.getTemplatePath(subKey); -// -// for (ClassGenerationAction generator : generators) { -// generator.setSuperTemplate(superTemplate); -// generator.setTemplate(subTemplate); -// generator.setOverwrite(view.getOverwrite().isSelected()); -// generator.setUsePkgPath(view.getUsePackagePath().isSelected()); -// generator.setMakePairs(view.getPairs().isSelected()); -// generator.setCreatePropertyNames(view.getCreatePropertyNames().isSelected()); -// generator.setCreatePKProperties(view.getCreatePKProperties().isSelected()); -// -// if (!Util.isEmptyString(view.getOutputPattern().getText())) { -// generator.setOutputPattern(view.getOutputPattern().getText()); -// } -// } -// -// return generators; -// } -// -// public void popPreferencesAction() { -// new PreferenceDialog(getApplication().getFrameController()).startupAction(TEMPLATES_KEY); -// updateTemplates(); -// } -// -// @Override -// protected ClassGenerationAction newGenerator() { -// ClassGenerationAction action = new ClassGenerationAction(); -// getApplication().getInjector().injectMembers(action); -// return action; -// } -//} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModePanel.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModePanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModePanel.java deleted file mode 100644 index 6396abd..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModePanel.java +++ /dev/null @@ -1,137 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import com.jgoodies.forms.builder.DefaultFormBuilder; -//import com.jgoodies.forms.layout.FormLayout; -//import org.apache.cayenne.swing.control.ActionLink; -// -//import javax.swing.JCheckBox; -//import javax.swing.JComboBox; -//import javax.swing.JPanel; -//import javax.swing.JTextField; -//import java.awt.BorderLayout; -//import java.awt.FlowLayout; -// -//public class CustomModePanel extends GeneratorControllerPanel { -// -// private JComboBox<String> subclassTemplate; -// private JComboBox<String> superclassTemplate; -// protected JCheckBox pairs; -// private JCheckBox overwrite; -// private JCheckBox usePackagePath; -// private JTextField outputPattern; -// private JCheckBox createPropertyNames; -// private JCheckBox createPKProperties; -// -// private ActionLink manageTemplatesLink; -// -// CustomModePanel() { -// -// this.superclassTemplate = new JComboBox<>(); -// this.subclassTemplate = new JComboBox<>(); -// this.pairs = new JCheckBox(); -// this.overwrite = new JCheckBox(); -// this.usePackagePath = new JCheckBox(); -// this.outputPattern = new JTextField(); -// this.createPropertyNames = new JCheckBox(); -// this.createPKProperties = new JCheckBox(); -// this.manageTemplatesLink = new ActionLink("Customize Templates..."); -// manageTemplatesLink.setFont(manageTemplatesLink.getFont().deriveFont(10f)); -// -// // assemble -// FormLayout layout = new FormLayout( -// "right:77dlu, 1dlu, fill:100:grow, 1dlu, left:80dlu, 1dlu", ""); -// DefaultFormBuilder builder = new DefaultFormBuilder(layout); -// builder.setDefaultDialogBorder(); -// -// builder.append("Output Directory:", outputFolder, selectOutputFolder); -// builder.nextLine(); -// -// builder.append("Subclass Template:", subclassTemplate); -// builder.nextLine(); -// -// builder.append("Superclass Template:", superclassTemplate); -// builder.nextLine(); -// -// builder.append("Output Pattern:", outputPattern); -// builder.nextLine(); -// -// builder.append("Make Pairs:", pairs); -// builder.nextLine(); -// -// builder.append("Use Package Path:", usePackagePath); -// builder.nextLine(); -// -// builder.append("Overwrite Subclasses:", overwrite); -// builder.nextLine(); -// -// builder.append("Create Property Names:", createPropertyNames); -// builder.nextLine(); -// -// builder.append("Create PK Properties:", createPKProperties); -// builder.nextLine(); -// -// setLayout(new BorderLayout()); -// add(builder.getPanel(), BorderLayout.CENTER); -// -// JPanel links = new JPanel(new FlowLayout(FlowLayout.RIGHT)); -// links.add(manageTemplatesLink); -// add(links, BorderLayout.SOUTH); -// -// add(builder.getPanel(), BorderLayout.CENTER); -// } -// -// public ActionLink getManageTemplatesLink() { -// return manageTemplatesLink; -// } -// -// public JComboBox<String> getSubclassTemplate() { -// return subclassTemplate; -// } -// -// public JComboBox<String> getSuperclassTemplate() { -// return superclassTemplate; -// } -// -// public JCheckBox getOverwrite() { -// return overwrite; -// } -// -// public JCheckBox getPairs() { -// return pairs; -// } -// -// public JCheckBox getUsePackagePath() { -// return usePackagePath; -// } -// -// public JTextField getOutputPattern() { -// return outputPattern; -// } -// -// public JCheckBox getCreatePropertyNames() { -// return createPropertyNames; -// } -// -// public JCheckBox getCreatePKProperties() { -// return createPKProperties; -// } -//} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomPreferencesUpdater.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomPreferencesUpdater.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomPreferencesUpdater.java deleted file mode 100644 index a9816e0..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomPreferencesUpdater.java +++ /dev/null @@ -1,209 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import org.apache.cayenne.map.DataMap; -//import org.apache.cayenne.modeler.pref.DataMapDefaults; -// -//import java.util.Map; -//import java.util.Map.Entry; -//import java.util.Set; -// -//public class CustomPreferencesUpdater { -// -// enum Property { -// SUBCLASS_TEMPLATE, -// SUPERCLASS_TEMPLATE, -// OVERWRITE, -// PAIRS, -// USE_PACKAGE_PATH, -// MODE, -// OUTPUT_PATTERN, -// CREATE_PROPERTY_NAMES, -// CREATE_PK_PROPERTIES -// } -// -// private static final String OVERWRITE = "overwrite"; -// private static final String PAIRS = "pairs"; -// private static final String USE_PACKAGE_PATH = "usePackagePath"; -// private static final String MODE = "mode"; -// private static final String OUTPUT_PATTERN = "outputPattern"; -// private static final String CREATE_PROPERTY_NAMES = "createPropertyNames"; -// private static final String CREATE_PK_PROPERTIES = "createPKProperties"; -// -// private Map<DataMap, DataMapDefaults> mapPreferences; -// -// -// public CustomPreferencesUpdater(Map<DataMap, DataMapDefaults> mapPreferences) { -// this.mapPreferences = mapPreferences; -// } -// -// public String getMode() { -// return (String) getProperty(Property.MODE); -// } -// -// public void setMode(String mode) { -// updatePreferences(Property.MODE, mode); -// } -// -// public String getSubclassTemplate() { -// return (String) getProperty(Property.SUBCLASS_TEMPLATE); -// } -// -// public void setSubclassTemplate(String subclassTemplate) { -// updatePreferences(Property.SUBCLASS_TEMPLATE, subclassTemplate); -// } -// -// public String getSuperclassTemplate() { -// return (String) getProperty(Property.SUPERCLASS_TEMPLATE); -// } -// -// public void setSuperclassTemplate(String superclassTemplate) { -// updatePreferences(Property.SUPERCLASS_TEMPLATE, superclassTemplate); -// } -// -// public Boolean getOverwrite() { -// return (Boolean) getProperty(Property.OVERWRITE); -// } -// -// public void setOverwrite(Boolean overwrite) { -// updatePreferences(Property.OVERWRITE, overwrite); -// } -// -// public Boolean getPairs() { -// return (Boolean) getProperty(Property.PAIRS); -// } -// -// public void setPairs(Boolean pairs) { -// updatePreferences(Property.PAIRS, pairs); -// } -// -// public Boolean getUsePackagePath() { -// return (Boolean) getProperty(Property.USE_PACKAGE_PATH); -// } -// -// public void setUsePackagePath(Boolean usePackagePath) { -// updatePreferences(Property.USE_PACKAGE_PATH, usePackagePath); -// } -// -// public String getOutputPattern() { -// return (String) getProperty(Property.OUTPUT_PATTERN); -// } -// -// public void setOutputPattern(String outputPattern) { -// updatePreferences(Property.OUTPUT_PATTERN, outputPattern); -// } -// -// public Boolean getCreatePropertyNames() { -// return (Boolean) getProperty(Property.CREATE_PROPERTY_NAMES); -// } -// -// public void setCreatePropertyNames(Boolean createPropertyNames) { -// updatePreferences(Property.CREATE_PROPERTY_NAMES, createPropertyNames); -// } -// -// public Boolean getCreatePKProperties() { -// return (Boolean) getProperty(Property.CREATE_PK_PROPERTIES); -// } -// -// public void setCreatePKProperties(Boolean createPKProperties) { -// updatePreferences(Property.CREATE_PK_PROPERTIES, createPKProperties); -// } -// -// private Object getProperty(Property property) { -// Object obj = null; -// -// Set<Entry<DataMap, DataMapDefaults>> entities = mapPreferences.entrySet(); -// for (Entry<DataMap, DataMapDefaults> entry : entities) { -// -// switch (property) { -// case MODE: -// obj = entry.getValue().getProperty(MODE); -// break; -// case OUTPUT_PATTERN: -// obj = entry.getValue().getProperty(OUTPUT_PATTERN); -// break; -// case SUBCLASS_TEMPLATE: -// obj = entry.getValue().getSubclassTemplate(); -// break; -// case SUPERCLASS_TEMPLATE: -// obj = entry.getValue().getSuperclassTemplate(); -// break; -// case OVERWRITE: -// obj = entry.getValue().getBooleanProperty(OVERWRITE); -// break; -// case PAIRS: -// obj = entry.getValue().getBooleanProperty(PAIRS); -// break; -// case USE_PACKAGE_PATH: -// obj = entry.getValue().getBooleanProperty(USE_PACKAGE_PATH); -// break; -// case CREATE_PROPERTY_NAMES: -// obj = entry.getValue().getBooleanProperty(CREATE_PROPERTY_NAMES); -// break; -// case CREATE_PK_PROPERTIES: -// obj = entry.getValue().getBooleanProperty(CREATE_PK_PROPERTIES); -// break; -// default: -// throw new IllegalArgumentException("Bad type property: " + property); -// } -// -// } -// return obj; -// } -// -// private void updatePreferences(Property property, Object value) { -// Set<Entry<DataMap, DataMapDefaults>> entities = mapPreferences.entrySet(); -// for (Entry<DataMap, DataMapDefaults> entry : entities) { -// -// switch (property) { -// case MODE: -// entry.getValue().setProperty(MODE, (String) value); -// break; -// case OUTPUT_PATTERN: -// entry.getValue().setProperty(OUTPUT_PATTERN, (String) value); -// break; -// case SUBCLASS_TEMPLATE: -// entry.getValue().setSubclassTemplate((String) value); -// break; -// case SUPERCLASS_TEMPLATE: -// entry.getValue().setSuperclassTemplate((String) value); -// break; -// case OVERWRITE: -// entry.getValue().setBooleanProperty(OVERWRITE, (Boolean) value); -// break; -// case PAIRS: -// entry.getValue().setBooleanProperty(PAIRS, (Boolean) value); -// break; -// case USE_PACKAGE_PATH: -// entry.getValue().setBooleanProperty(USE_PACKAGE_PATH, (Boolean) value); -// break; -// case CREATE_PROPERTY_NAMES: -// entry.getValue().setBooleanProperty(CREATE_PROPERTY_NAMES, (Boolean) value); -// break; -// case CREATE_PK_PROPERTIES: -// entry.getValue().setBooleanProperty(CREATE_PK_PROPERTIES, (Boolean) value); -// break; -// default: -// throw new IllegalArgumentException("Bad type property: " + property); -// } -// } -// } -//} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java deleted file mode 100644 index 4a5b5f6..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java +++ /dev/null @@ -1,561 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import org.apache.cayenne.CayenneRuntimeException; -//import org.apache.cayenne.gen.ArtifactsGenerationMode; -//import org.apache.cayenne.gen.ClassGenerationAction; -//import org.apache.cayenne.map.DataMap; -//import org.apache.cayenne.map.Embeddable; -//import org.apache.cayenne.map.EmbeddableAttribute; -//import org.apache.cayenne.map.EmbeddedAttribute; -//import org.apache.cayenne.map.ObjAttribute; -//import org.apache.cayenne.map.ObjEntity; -//import org.apache.cayenne.map.ObjRelationship; -//import org.apache.cayenne.modeler.Application; -//import org.apache.cayenne.modeler.dialog.pref.GeneralPreferences; -//import org.apache.cayenne.modeler.pref.DataMapDefaults; -//import org.apache.cayenne.modeler.pref.FSPath; -//import org.apache.cayenne.modeler.util.CayenneController; -//import org.apache.cayenne.modeler.util.CodeValidationUtil; -//import org.apache.cayenne.swing.BindingBuilder; -//import org.apache.cayenne.util.Util; -//import org.apache.cayenne.validation.BeanValidationFailure; -//import org.apache.cayenne.validation.SimpleValidationFailure; -//import org.apache.cayenne.validation.ValidationFailure; -//import org.apache.cayenne.validation.ValidationResult; -// -//import javax.swing.JButton; -//import javax.swing.JFileChooser; -//import javax.swing.JOptionPane; -//import javax.swing.JTextField; -//import java.io.File; -//import java.util.ArrayList; -//import java.util.Collection; -//import java.util.LinkedList; -//import java.util.Map; -//import java.util.Set; -//import java.util.function.Predicate; -//import java.util.prefs.Preferences; -// -///** -// * A mode-specific part of the code generation dialog. -// * -// */ -//public abstract class GeneratorController extends CayenneController { -// -// protected String mode = ArtifactsGenerationMode.ALL.getLabel(); -// protected Map<DataMap, DataMapDefaults> mapPreferences; -// private String outputPath; -// -// public GeneratorController(CodeGeneratorControllerBase parent) { -// super(parent); -// -// createDefaults(); -// createView(); -// initBindings(new BindingBuilder(getApplication().getBindingFactory(), this)); -// } -// -// public String getOutputPath() { -// return outputPath; -// } -// -// public void setOutputPath(String path) { -// String old = this.outputPath; -// this.outputPath = path; -// if (this.outputPath != null && !this.outputPath.equals(old)) { -// updatePreferences(path); -// } -// } -// -// public void updatePreferences(String path) { -// if (mapPreferences == null) -// return; -// Set<DataMap> keys = mapPreferences.keySet(); -// for (DataMap key : keys) { -// mapPreferences -// .get(key) -// .setOutputPath(path); -// } -// } -// -// public void setMapPreferences(Map<DataMap, DataMapDefaults> mapPreferences) { -// this.mapPreferences = mapPreferences; -// } -// -// public Map<DataMap, DataMapDefaults> getMapPreferences() { -// return this.mapPreferences; -// } -// -// protected void initBindings(BindingBuilder bindingBuilder) { -// -// initOutputFolder(); -// -// JTextField outputFolder = ((GeneratorControllerPanel) getView()).getOutputFolder(); -// JButton outputSelect = ((GeneratorControllerPanel) getView()).getSelectOutputFolder(); -// -// outputFolder.setText(getOutputPath()); -// bindingBuilder.bindToAction(outputSelect, "selectOutputFolderAction()"); -// bindingBuilder.bindToTextField(outputFolder, "outputPath"); -// } -// -// protected CodeGeneratorControllerBase getParentController() { -// return (CodeGeneratorControllerBase) getParent(); -// } -// -// protected abstract GeneratorControllerPanel createView(); -// -// protected abstract void createDefaults(); -// -// /** -// * Creates an appropriate subclass of {@link ClassGenerationAction}, -// * returning it in an unconfigured state. Configuration is performed by -// * {@link #createConfiguration()} method. -// */ -// protected abstract ClassGenerationAction newGenerator(); -// -// /** -// * Creates a class generator for provided selections. -// */ -// public Collection<ClassGenerationAction> createConfiguration() { -// -// File outputDir = getOutputDir(); -// -// // no destination folder -// if (outputDir == null) { -// JOptionPane.showMessageDialog(this.getView(), "Select directory for source files."); -// return null; -// } -// -// // no such folder -// if (!outputDir.exists() && !outputDir.mkdirs()) { -// JOptionPane.showMessageDialog(this.getView(), "Can't create directory " + outputDir -// + ". Select a different one."); -// return null; -// } -// -// // not a directory -// if (!outputDir.isDirectory()) { -// JOptionPane.showMessageDialog(this.getView(), outputDir + " is not a valid directory."); -// return null; -// } -// -// // remove generic entities... -// Collection<ObjEntity> selectedEntities = new ArrayList<>(getParentController().getSelectedEntities()); -// selectedEntities.removeIf(ObjEntity::isGeneric); -// -// Collection<ClassGenerationAction> generators = new ArrayList<>(); -// for (DataMap map : getParentController().getDataMaps()) { -// try { -// ClassGenerationAction generator = newGenerator(); -// -// if(getParentController().getSelectedDataMaps().contains(map)) { -// mode = ArtifactsGenerationMode.ALL.getLabel(); -// } else { -// mode = ArtifactsGenerationMode.ENTITY.getLabel(); -// } -// -// generator.setArtifactsGenerationMode(mode); -// generator.setDataMap(map); -// -// LinkedList<ObjEntity> objEntities = new LinkedList<>(map.getObjEntities()); -// objEntities.retainAll(selectedEntities); -// generator.addEntities(objEntities); -// -// LinkedList<Embeddable> embeddables = new LinkedList<>(map.getEmbeddables()); -// embeddables.retainAll(getParentController().getSelectedEmbeddables()); -// generator.addEmbeddables(embeddables); -// -// generator.addQueries(map.getQueryDescriptors()); -// -// Preferences preferences = application.getPreferencesNode(GeneralPreferences.class, ""); -// -// if (preferences != null) { -// generator.setEncoding(preferences.get(GeneralPreferences.ENCODING_PREFERENCE, null)); -// -// } -// -// generator.setMakePairs(true); -// generator.setForce(true); -// -// generators.add(generator); -// } catch (CayenneRuntimeException exception) { -// JOptionPane.showMessageDialog(this.getView(), exception.getUnlabeledMessage()); -// return null; -// } -// } -// -// return generators; -// } -// -// public void validateEmbeddable(ValidationResult validationBuffer, Embeddable embeddable) { -// ValidationFailure embeddableFailure = validateEmbeddable(embeddable); -// if (embeddableFailure != null) { -// validationBuffer.addFailure(embeddableFailure); -// return; -// } -// -// for (EmbeddableAttribute attribute : embeddable.getAttributes()) { -// ValidationFailure failure = validateEmbeddableAttribute(attribute); -// if (failure != null) { -// validationBuffer.addFailure(failure); -// return; -// } -// } -// } -// -// private ValidationFailure validateEmbeddableAttribute(EmbeddableAttribute attribute) { -// String name = attribute.getEmbeddable().getClassName(); -// -// ValidationFailure emptyName = BeanValidationFailure.validateNotEmpty(name, "attribute.name", -// attribute.getName()); -// if (emptyName != null) { -// return emptyName; -// } -// -// ValidationFailure badName = CodeValidationUtil.validateJavaIdentifier(name, "attribute.name", -// attribute.getName()); -// if (badName != null) { -// return badName; -// } -// -// ValidationFailure emptyType = BeanValidationFailure.validateNotEmpty(name, "attribute.type", -// attribute.getType()); -// if (emptyType != null) { -// return emptyType; -// } -// -// ValidationFailure badType = BeanValidationFailure.validateJavaClassName(name, "attribute.type", -// attribute.getType()); -// if (badType != null) { -// return badType; -// } -// -// return null; -// } -// -// private ValidationFailure validateEmbeddable(Embeddable embeddable) { -// -// String name = embeddable.getClassName(); -// -// ValidationFailure emptyClass = BeanValidationFailure.validateNotEmpty(name, "className", -// embeddable.getClassName()); -// if (emptyClass != null) { -// return emptyClass; -// } -// -// ValidationFailure badClass = BeanValidationFailure.validateJavaClassName(name, "className", -// embeddable.getClassName()); -// if (badClass != null) { -// return badClass; -// } -// -// return null; -// } -// -// public void validateEntity(ValidationResult validationBuffer, ObjEntity entity, boolean clientValidation) { -// -// ValidationFailure entityFailure = validateEntity(clientValidation ? entity.getClientEntity() : entity); -// if (entityFailure != null) { -// validationBuffer.addFailure(entityFailure); -// return; -// } -// -// for (ObjAttribute attribute : entity.getAttributes()) { -// if (attribute instanceof EmbeddedAttribute) { -// EmbeddedAttribute embeddedAttribute = (EmbeddedAttribute) attribute; -// for (ObjAttribute subAttribute : embeddedAttribute.getAttributes()) { -// ValidationFailure failure = validateEmbeddedAttribute(subAttribute); -// if (failure != null) { -// validationBuffer.addFailure(failure); -// return; -// } -// } -// } else { -// -// ValidationFailure failure = validateAttribute(attribute); -// if (failure != null) { -// validationBuffer.addFailure(failure); -// return; -// } -// } -// } -// -// for (ObjRelationship rel : entity.getRelationships()) { -// ValidationFailure failure = validateRelationship(rel, clientValidation); -// if (failure != null) { -// validationBuffer.addFailure(failure); -// return; -// } -// } -// } -// -// private ValidationFailure validateEntity(ObjEntity entity) { -// -// String name = entity.getName(); -// -// if (entity.isGeneric()) { -// return new SimpleValidationFailure(name, "Generic class"); -// } -// -// ValidationFailure emptyClass = BeanValidationFailure.validateNotEmpty(name, "className", entity.getClassName()); -// if (emptyClass != null) { -// return emptyClass; -// } -// -// ValidationFailure badClass = BeanValidationFailure.validateJavaClassName(name, "className", -// entity.getClassName()); -// if (badClass != null) { -// return badClass; -// } -// -// if (entity.getSuperClassName() != null) { -// ValidationFailure badSuperClass = BeanValidationFailure.validateJavaClassName(name, "superClassName", -// entity.getSuperClassName()); -// if (badSuperClass != null) { -// return badSuperClass; -// } -// } -// -// return null; -// } -// -// private ValidationFailure validateAttribute(ObjAttribute attribute) { -// -// String name = attribute.getEntity().getName(); -// -// ValidationFailure emptyName = BeanValidationFailure.validateNotEmpty(name, "attribute.name", -// attribute.getName()); -// if (emptyName != null) { -// return emptyName; -// } -// -// ValidationFailure badName = CodeValidationUtil.validateJavaIdentifier(name, "attribute.name", -// attribute.getName()); -// if (badName != null) { -// return badName; -// } -// -// ValidationFailure emptyType = BeanValidationFailure.validateNotEmpty(name, "attribute.type", -// attribute.getType()); -// if (emptyType != null) { -// return emptyType; -// } -// -// ValidationFailure badType = BeanValidationFailure.validateJavaClassName(name, "attribute.type", -// attribute.getType()); -// if (badType != null) { -// return badType; -// } -// -// return null; -// } -// -// private ValidationFailure validateEmbeddedAttribute(ObjAttribute attribute) { -// -// String name = attribute.getEntity().getName(); -// -// // validate embeddedAttribute and attribute names -// // embeddedAttribute returned attibute as -// // [name_embeddedAttribute].[name_attribute] -// String[] attributes = attribute.getName().split("\\."); -// String nameEmbeddedAttribute = attributes[0]; -// int beginIndex = attributes[0].length(); -// String attr = attribute.getName().substring(beginIndex + 1); -// -// ValidationFailure emptyEmbeddedName = BeanValidationFailure.validateNotEmpty(name, "attribute.name", -// nameEmbeddedAttribute); -// if (emptyEmbeddedName != null) { -// return emptyEmbeddedName; -// } -// -// ValidationFailure badEmbeddedName = CodeValidationUtil.validateJavaIdentifier(name, "attribute.name", -// nameEmbeddedAttribute); -// if (badEmbeddedName != null) { -// return badEmbeddedName; -// } -// -// ValidationFailure emptyName = BeanValidationFailure.validateNotEmpty(name, "attribute.name", attr); -// if (emptyName != null) { -// return emptyName; -// } -// -// ValidationFailure badName = CodeValidationUtil.validateJavaIdentifier(name, "attribute.name", attr); -// if (badName != null) { -// return badName; -// } -// -// ValidationFailure emptyType = BeanValidationFailure.validateNotEmpty(name, "attribute.type", -// attribute.getType()); -// if (emptyType != null) { -// return emptyType; -// } -// -// ValidationFailure badType = BeanValidationFailure.validateJavaClassName(name, "attribute.type", -// attribute.getType()); -// if (badType != null) { -// return badType; -// } -// -// return null; -// } -// -// private ValidationFailure validateRelationship(ObjRelationship relationship, boolean clientValidation) { -// -// String name = relationship.getSourceEntity().getName(); -// -// ValidationFailure emptyName = BeanValidationFailure.validateNotEmpty(name, "relationship.name", -// relationship.getName()); -// if (emptyName != null) { -// return emptyName; -// } -// -// ValidationFailure badName = CodeValidationUtil.validateJavaIdentifier(name, "relationship.name", -// relationship.getName()); -// if (badName != null) { -// return badName; -// } -// -// if (!relationship.isToMany()) { -// -// ObjEntity targetEntity = relationship.getTargetEntity(); -// -// if (clientValidation && targetEntity != null) { -// targetEntity = targetEntity.getClientEntity(); -// } -// -// if (targetEntity == null) { -// -// return new BeanValidationFailure(name, "relationship.targetEntity", "No target entity"); -// } else if (!targetEntity.isGeneric()) { -// ValidationFailure emptyClass = BeanValidationFailure.validateNotEmpty(name, -// "relationship.targetEntity.className", targetEntity.getClassName()); -// if (emptyClass != null) { -// return emptyClass; -// } -// -// ValidationFailure badClass = BeanValidationFailure.validateJavaClassName(name, -// "relationship.targetEntity.className", targetEntity.getClassName()); -// if (badClass != null) { -// return badClass; -// } -// } -// } -// -// return null; -// } -// -// /** -// * Returns a predicate for default entity selection in a given mode. -// */ -// public Predicate getDefaultClassFilter() { -// return object -> { -// if (object instanceof ObjEntity) { -// return getParentController().getProblem(((ObjEntity) object).getName()) == null; -// } -// -// if (object instanceof Embeddable) { -// return getParentController().getProblem(((Embeddable) object).getClassName()) == null; -// } -// -// return false; -// }; -// } -// -// private File getOutputDir() { -// String dir = ((GeneratorControllerPanel) getView()).getOutputFolder().getText(); -// return dir != null ? new File(dir) : new File(System.getProperty("user.dir")); -// } -// -// /** -// * An action method that pops up a file chooser dialog to pick the -// * generation directory. -// */ -// public void selectOutputFolderAction() { -// -// JTextField outputFolder = ((GeneratorControllerPanel) getView()).getOutputFolder(); -// -// String currentDir = outputFolder.getText(); -// -// JFileChooser chooser = new JFileChooser(); -// chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); -// chooser.setDialogType(JFileChooser.OPEN_DIALOG); -// -// // guess start directory -// if (!Util.isEmptyString(currentDir)) { -// chooser.setCurrentDirectory(new File(currentDir)); -// } else { -// FSPath lastDir = Application.getInstance().getFrameController().getLastDirectory(); -// lastDir.updateChooser(chooser); -// } -// -// int result = chooser.showOpenDialog(getView()); -// if (result == JFileChooser.APPROVE_OPTION) { -// File selected = chooser.getSelectedFile(); -// -// // update model -// String path = selected.getAbsolutePath(); -// outputFolder.setText(path); -// setOutputPath(path); -// } -// } -// -// private void initOutputFolder() { -// String path; -// if (getOutputPath() == null) { -// if (System.getProperty("cayenne.cgen.destdir") != null) { -// setOutputPath(System.getProperty("cayenne.cgen.destdir")); -// } else { -// // init default directory.. -// FSPath lastPath = Application.getInstance().getFrameController().getLastDirectory(); -// -// path = checkDefaultMavenResourceDir(lastPath, "test"); -// -// if (path != null || (path = checkDefaultMavenResourceDir(lastPath, "main")) != null) { -// setOutputPath(path); -// } else { -// File lastDir = (lastPath != null) ? lastPath.getExistingDirectory(false) : null; -// setOutputPath(lastDir != null ? lastDir.getAbsolutePath() : null); -// } -// } -// } -// } -// -// private String checkDefaultMavenResourceDir(FSPath lastPath, String dirType) { -// String path = lastPath.getPath(); -// String resourcePath = buildFilePath("src", dirType, "resources"); -// int idx = path.indexOf(resourcePath); -// if (idx < 0) { -// return null; -// } -// return path.substring(0, idx) + buildFilePath("src", dirType, "java"); -// } -// -// private static String buildFilePath(String... pathElements) { -// if (pathElements.length == 0) { -// return ""; -// } -// StringBuilder path = new StringBuilder(pathElements[0]); -// for (int i = 1; i < pathElements.length; i++) { -// path.append(File.separator).append(pathElements[i]); -// } -// return path.toString(); -// } -//} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorControllerPanel.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorControllerPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorControllerPanel.java deleted file mode 100644 index 276284f..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorControllerPanel.java +++ /dev/null @@ -1,55 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import javax.swing.JButton; -//import javax.swing.JPanel; -//import javax.swing.JTextField; -//import java.util.ArrayList; -//import java.util.Collection; -// -///** -// * A generic panel that is a superclass of generator panels, defining common fields. -// * -// */ -//public class GeneratorControllerPanel extends JPanel { -// -// protected Collection<StandardPanelComponent> dataMapLines; -// protected JTextField outputFolder; -// protected JButton selectOutputFolder; -// -// public GeneratorControllerPanel() { -// this.dataMapLines = new ArrayList<>(); -// this.outputFolder = new JTextField(); -// this.selectOutputFolder = new JButton("Select"); -// } -// -// public JTextField getOutputFolder() { -// return outputFolder; -// } -// -// public JButton getSelectOutputFolder() { -// return selectOutputFolder; -// } -// -// public Collection<StandardPanelComponent> getDataMapLines() { -// return dataMapLines; -// } -//} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabController.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabController.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabController.java deleted file mode 100644 index 8b915fe..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabController.java +++ /dev/null @@ -1,115 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import org.apache.cayenne.gen.ClassGenerationAction; -//import org.apache.cayenne.modeler.util.CayenneController; -//import org.apache.cayenne.pref.CayenneProjectPreferences; -//import org.apache.cayenne.pref.PreferenceDetail; -//import org.apache.cayenne.swing.BindingBuilder; -//import org.apache.cayenne.util.Util; -// -//import java.awt.Component; -//import java.awt.Dimension; -//import java.util.Collection; -//import java.util.HashMap; -//import java.util.Map; -// -///** -// */ -//public class GeneratorTabController extends CayenneController { -// -// private static final String STANDARD_OBJECTS_MODE = "Standard Persistent Objects"; -// private static final String CLIENT_OBJECTS_MODE = "Client Persistent Objects"; -// private static final String ADVANCED_MODE = "Advanced"; -// -// public static final String GENERATOR_PROPERTY = "generator"; -// -// private static final String[] GENERATION_MODES = new String[] { -// STANDARD_OBJECTS_MODE, CLIENT_OBJECTS_MODE, ADVANCED_MODE -// }; -// -// protected GeneratorTabPanel view; -// protected Map controllers; -// protected PreferenceDetail preferences; -// -// public GeneratorTabController(CodeGeneratorControllerBase parent) { -// super(parent); -// -// this.controllers = new HashMap(5); -// controllers.put(STANDARD_OBJECTS_MODE, new StandardModeController(parent)); -// controllers.put(CLIENT_OBJECTS_MODE, new ClientModeController(parent)); -// controllers.put(ADVANCED_MODE, new CustomModeController(parent)); -// -// Component[] modePanels = new Component[GENERATION_MODES.length]; -// for (int i = 0; i < GENERATION_MODES.length; i++) { -// modePanels[i] = ((GeneratorController) controllers.get(GENERATION_MODES[i])) -// .getView(); -// } -// -// this.view = new GeneratorTabPanel(GENERATION_MODES, modePanels); -// initBindings(); -// view.setPreferredSize(new Dimension(600, 480)); -// } -// -// public Component getView() { -// return view; -// } -// -// protected CodeGeneratorControllerBase getParentController() { -// return (CodeGeneratorControllerBase) getParent(); -// } -// -// protected void initBindings() { -// -// // bind actions -// BindingBuilder builder = new BindingBuilder( -// getApplication().getBindingFactory(), -// this); -// -// CayenneProjectPreferences cayPrPref = application.getCayenneProjectPreferences(); -// -// this.preferences = (PreferenceDetail) cayPrPref.getProjectDetailObject( -// PreferenceDetail.class, -// getViewPreferences().node("controller")); -// -// if (Util.isEmptyString(preferences.getProperty("mode"))) { -// preferences.setProperty("mode", STANDARD_OBJECTS_MODE); -// } -// -// builder.bindToComboSelection( -// view.getGenerationMode(), -// "preferences.property['mode']").updateView(); -// } -// -// public PreferenceDetail getPreferences() { -// return preferences; -// } -// -// public GeneratorController getGeneratorController() { -// Object name = view.getGenerationMode().getSelectedItem(); -// return (GeneratorController) controllers.get(name); -// } -// -// public Collection<ClassGenerationAction> getConfiguration() { -// GeneratorController modeController = getGeneratorController(); -// return (modeController != null) ? modeController.createConfiguration() : null; -// } -//} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabPanel.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabPanel.java deleted file mode 100644 index c6095ad..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabPanel.java +++ /dev/null @@ -1,65 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import com.jgoodies.forms.builder.DefaultFormBuilder; -//import com.jgoodies.forms.layout.FormLayout; -// -//import javax.swing.JComboBox; -//import javax.swing.JPanel; -//import java.awt.BorderLayout; -//import java.awt.CardLayout; -//import java.awt.Component; -// -///** -// */ -//public class GeneratorTabPanel extends JPanel { -// -// protected JComboBox generationMode; -// protected CardLayout modeLayout; -// protected JPanel modesPanel; -// -// public GeneratorTabPanel(String[] modeNames, Component[] modePanels) { -// this.generationMode = new JComboBox(modeNames); -// this.modeLayout = new CardLayout(); -// this.modesPanel = new JPanel(modeLayout); -// -// generationMode.addItemListener(e -> modeLayout.show(modesPanel, generationMode.getSelectedItem().toString())); -// -// // assemble -// FormLayout layout = new FormLayout("right:70dlu, 3dlu, fill:300, fill:100dlu:grow", ""); -// DefaultFormBuilder builder = new DefaultFormBuilder(layout); -// builder.setDefaultDialogBorder(); -// builder.append("Type:", generationMode, 1); -// builder.appendSeparator(); -// -// for (int i = 0; i < modeNames.length; i++) { -// modesPanel.add(modePanels[i], modeNames[i]); -// } -// -// setLayout(new BorderLayout()); -// add(builder.getPanel(), BorderLayout.NORTH); -// add(modesPanel, BorderLayout.CENTER); -// } -// -// public JComboBox getGenerationMode() { -// return generationMode; -// } -//} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/b30e5eb5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/StandardModeController.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/StandardModeController.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/StandardModeController.java deleted file mode 100644 index 547f408..0000000 --- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/StandardModeController.java +++ /dev/null @@ -1,82 +0,0 @@ -///***************************************************************** -// * 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.dialog.codegen; -// -//import org.apache.cayenne.gen.ClassGenerationAction; -//import org.apache.cayenne.map.DataMap; -//import org.apache.cayenne.modeler.pref.DataMapDefaults; -// -//import java.awt.Component; -//import java.util.ArrayList; -//import java.util.Collection; -//import java.util.TreeMap; -// -//public class StandardModeController extends GeneratorController { -// -// protected StandardModePanel view; -// protected DataMapDefaults preferences; -// -// public StandardModeController(CodeGeneratorControllerBase parent) { -// super(parent); -// } -// -// protected void createDefaults() { -// TreeMap<DataMap, DataMapDefaults> treeMap = new TreeMap<>(); -// ArrayList<DataMap> dataMaps = (ArrayList<DataMap>) getParentController().getDataMaps(); -// -// for (DataMap dataMap : dataMaps) { -// DataMapDefaults preferences = getApplication() -// .getFrameController() -// .getProjectController() -// .getDataMapPreferences(dataMap); -// -// preferences.setSuperclassPackage(""); -// preferences.updateSuperclassPackage(dataMap, false); -// -// treeMap.put(dataMap, preferences); -// if (getOutputPath() == null) { -// setOutputPath(preferences.getOutputPath()); -// } -// } -// -// setMapPreferences(treeMap); -// } -// -// protected GeneratorControllerPanel createView() { -// this.view = new StandardModePanel(); -// return view; -// } -// -// public Component getView() { -// return view; -// } -// -// @Override -// protected ClassGenerationAction newGenerator() { -// ClassGenerationAction action = new ClassGenerationAction(); -// getApplication().getInjector().injectMembers(action); -// return action; -// } -// -// @Override -// public Collection<ClassGenerationAction> createConfiguration() { -// return super.createConfiguration(); -// } -//} \ No newline at end of file