Search in sources :

Example 1 with MoveImportNodeAction

use of org.apache.cayenne.modeler.action.dbimport.MoveImportNodeAction in project cayenne by apache.

the class DraggableTreePanel method initElement.

private void initElement() {
    sourceTree.setDragEnabled(true);
    sourceTree.setCellRenderer(new ColorTreeRenderer());
    sourceTree.setDropMode(DropMode.INSERT);
    MoveImportNodeAction action = projectController.getApplication().getActionManager().getAction(MoveImportNodeAction.class);
    action.setPanel(this);
    action.setSourceTree(sourceTree);
    action.setTargetTree(targetTree);
    moveButton = (CayenneAction.CayenneToolbarButton) action.buildButton();
    moveButton.setShowingText(true);
    moveButton.setText(MOVE_BUTTON_LABEL);
    MoveInvertNodeAction actionInv = projectController.getApplication().getActionManager().getAction(MoveInvertNodeAction.class);
    actionInv.setPanel(this);
    actionInv.setSourceTree(sourceTree);
    actionInv.setTargetTree(targetTree);
    moveInvertButton = (CayenneAction.CayenneToolbarButton) actionInv.buildButton();
    moveInvertButton.setShowingText(true);
    moveInvertButton.setText(MOVE_INV_BUTTON_LABEL);
    DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) sourceTree.getCellRenderer();
    renderer.setLeafIcon(null);
    renderer.setClosedIcon(null);
    renderer.setOpenIcon(null);
}
Also used : MoveInvertNodeAction(org.apache.cayenne.modeler.action.dbimport.MoveInvertNodeAction) ColorTreeRenderer(org.apache.cayenne.modeler.editor.dbimport.tree.ColorTreeRenderer) MoveImportNodeAction(org.apache.cayenne.modeler.action.dbimport.MoveImportNodeAction) DefaultTreeCellRenderer(javax.swing.tree.DefaultTreeCellRenderer) CayenneAction(org.apache.cayenne.modeler.util.CayenneAction)

Aggregations

DefaultTreeCellRenderer (javax.swing.tree.DefaultTreeCellRenderer)1 MoveImportNodeAction (org.apache.cayenne.modeler.action.dbimport.MoveImportNodeAction)1 MoveInvertNodeAction (org.apache.cayenne.modeler.action.dbimport.MoveInvertNodeAction)1 ColorTreeRenderer (org.apache.cayenne.modeler.editor.dbimport.tree.ColorTreeRenderer)1 CayenneAction (org.apache.cayenne.modeler.util.CayenneAction)1