| 1 | |
package org.jtheque.films.view.impl.panels.principals; |
| 2 | |
|
| 3 | |
import org.jdesktop.swingx.JXTree; |
| 4 | |
import org.jtheque.core.managers.view.able.components.IModel; |
| 5 | |
import org.jtheque.primary.controller.able.FormBean; |
| 6 | |
import org.jtheque.primary.view.able.ToolbarView; |
| 7 | |
import org.jtheque.primary.view.impl.components.panels.PrincipalDataPanel; |
| 8 | |
import org.jtheque.primary.view.impl.renderers.JThequeTreeCellRenderer; |
| 9 | |
import org.jtheque.primary.view.impl.sort.SortManager; |
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
public abstract class AbstractPrincipalDataPanel<M extends IModel> extends PrincipalDataPanel<M> { |
| 28 | |
private ToolbarView toolBar; |
| 29 | |
private JXTree tree; |
| 30 | |
|
| 31 | |
private final String dataType; |
| 32 | |
|
| 33 | 0 | private static final SortManager SORTER = new SortManager(); |
| 34 | |
|
| 35 | |
public AbstractPrincipalDataPanel(String dataType) { |
| 36 | 0 | super(); |
| 37 | |
|
| 38 | 0 | this.dataType = dataType; |
| 39 | 0 | } |
| 40 | |
|
| 41 | |
@Override |
| 42 | |
public final Object getImpl() { |
| 43 | 0 | return this; |
| 44 | |
} |
| 45 | |
|
| 46 | |
@Override |
| 47 | |
public final ToolbarView getToolbarView() { |
| 48 | 0 | return toolBar; |
| 49 | |
} |
| 50 | |
|
| 51 | |
@Override |
| 52 | |
public void clear() { |
| 53 | |
|
| 54 | 0 | } |
| 55 | |
|
| 56 | |
@Override |
| 57 | |
protected final JXTree getTree() { |
| 58 | 0 | return tree; |
| 59 | |
} |
| 60 | |
|
| 61 | |
@Override |
| 62 | |
public final String getDataType() { |
| 63 | 0 | return dataType; |
| 64 | |
} |
| 65 | |
|
| 66 | |
final void setToolBar(ToolbarView toolBar) { |
| 67 | 0 | this.toolBar = toolBar; |
| 68 | 0 | } |
| 69 | |
|
| 70 | |
final void initTree(){ |
| 71 | 0 | tree = new JXTree(getTreeModel()); |
| 72 | 0 | tree.setCellRenderer(new JThequeTreeCellRenderer()); |
| 73 | 0 | tree.putClientProperty("JTree.lineStyle", "None"); |
| 74 | 0 | } |
| 75 | |
|
| 76 | |
static SortManager getSorter() { |
| 77 | 0 | return SORTER; |
| 78 | |
} |
| 79 | |
|
| 80 | |
public abstract void fillFormBean(FormBean fb); |
| 81 | |
|
| 82 | |
public abstract void setCurrent(Object object); |
| 83 | |
} |