use of org.apache.cayenne.dbsync.reverse.dbimport.PatternParam in project cayenne by apache.
the class EditNodeAction method performAction.
@Override
public void performAction(ActionEvent e) {
if (tree.isEditing()) {
return;
}
if (e != null) {
if (tree.getSelectionPath() != null) {
tree.startEditingAtPath(tree.getSelectionPath());
}
}
if (actionName == null) {
return;
}
if (tree.getSelectionPath() != null) {
selectedElement = tree.getSelectedNode();
parentElement = (DbImportTreeNode) selectedElement.getParent();
if (parentElement != null) {
Object selectedObject = selectedElement.getUserObject();
ReverseEngineering reverseEngineeringOldCopy = new ReverseEngineering(tree.getReverseEngineering());
if (!Util.isEmptyString(actionName)) {
if (selectedObject instanceof FilterContainer) {
((FilterContainer) selectedObject).setName(actionName);
} else if (selectedObject instanceof PatternParam) {
((PatternParam) selectedObject).setPattern(actionName);
}
updateModel(true);
selectedElement = null;
}
if (!actionName.equals(EMPTY_NAME)) {
putReverseEngineeringToUndoManager(reverseEngineeringOldCopy);
}
}
}
}
use of org.apache.cayenne.dbsync.reverse.dbimport.PatternParam in project cayenne by apache.
the class AddPatternParamAction method addPatternParamToIncludeTable.
private void addPatternParamToIncludeTable(Class paramClass, Object selectedObject, String name, DbImportTreeNode node) {
IncludeTable includeTable = (IncludeTable) selectedObject;
PatternParam element = null;
if (paramClass == IncludeColumn.class) {
element = new IncludeColumn(name);
includeTable.addIncludeColumn((IncludeColumn) element);
} else if (paramClass == ExcludeColumn.class) {
element = new ExcludeColumn(name);
includeTable.addExcludeColumn((ExcludeColumn) element);
}
node.add(new DbImportTreeNode(element));
}
use of org.apache.cayenne.dbsync.reverse.dbimport.PatternParam in project cayenne by apache.
the class AddPatternParamAction method addPatternParamToContainer.
private void addPatternParamToContainer(Class paramClass, Object selectedObject, String name, DbImportTreeNode node) {
FilterContainer container = (FilterContainer) selectedObject;
PatternParam element = null;
if (paramClass == ExcludeTable.class) {
element = new ExcludeTable(name);
container.addExcludeTable((ExcludeTable) element);
} else if (paramClass == IncludeColumn.class) {
element = new IncludeColumn(name);
container.addIncludeColumn((IncludeColumn) element);
} else if (paramClass == ExcludeColumn.class) {
element = new ExcludeColumn(name);
container.addExcludeColumn((ExcludeColumn) element);
} else if (paramClass == IncludeProcedure.class) {
element = new IncludeProcedure(name);
container.addIncludeProcedure((IncludeProcedure) element);
} else if (paramClass == ExcludeProcedure.class) {
element = new ExcludeProcedure(name);
container.addExcludeProcedure((ExcludeProcedure) element);
}
node.add(new DbImportTreeNode(element));
}
Aggregations