1 package info.mikethomas.fahview.v6project.files.queue;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import javax.swing.Action;
25 import javax.swing.JComponent;
26 import javax.swing.JPanel;
27 import javax.swing.JToolBar;
28 import org.netbeans.core.spi.multiview.CloseOperationState;
29 import org.netbeans.core.spi.multiview.MultiViewElement;
30 import org.netbeans.core.spi.multiview.MultiViewElementCallback;
31 import org.openide.awt.UndoRedo;
32 import org.openide.util.Lookup;
33 import org.openide.util.NbBundle.Messages;
34 import org.openide.windows.TopComponent;
35
36
37
38
39
40
41
42 @MultiViewElement.Registration(
43 displayName = "#LBL_QueueFile_VISUAL",
44 iconBase = "info/mikethomas/fahview/v6project/files/queue/QueueFile.png",
45 mimeType = "application/x-fahqueue",
46 persistenceType = TopComponent.PERSISTENCE_NEVER,
47 preferredID = "QueueFileVisual",
48 position = 2000)
49 @Messages("LBL_QueueFile_VISUAL=Visual")
50 public final class QueueFileVisualElement extends JPanel implements MultiViewElement {
51
52 private QueueFileDataObject obj;
53 private JToolBar toolbar = new JToolBar();
54 private transient MultiViewElementCallback callback;
55
56
57
58
59
60
61 public QueueFileVisualElement(Lookup lkp) {
62 obj = lkp.lookup(QueueFileDataObject.class);
63 assert obj != null;
64 initComponents();
65 }
66
67
68 @Override
69 public String getName() {
70 return "QueueFileVisualElement";
71 }
72
73
74
75
76
77
78
79 private void initComponents() {
80
81 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
82 this.setLayout(layout);
83 layout.setHorizontalGroup(
84 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
85 .addGap(0, 400, Short.MAX_VALUE)
86 );
87 layout.setVerticalGroup(
88 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
89 .addGap(0, 300, Short.MAX_VALUE)
90 );
91 }
92
93
94
95
96 @Override
97 public JComponent getVisualRepresentation() {
98 return this;
99 }
100
101
102 @Override
103 public JComponent getToolbarRepresentation() {
104 return toolbar;
105 }
106
107
108 @Override
109 public Action[] getActions() {
110 return new Action[0];
111 }
112
113
114 @Override
115 public Lookup getLookup() {
116 return obj.getLookup();
117 }
118
119
120 @Override
121 public void componentOpened() {
122 }
123
124
125 @Override
126 public void componentClosed() {
127 }
128
129
130 @Override
131 public void componentShowing() {
132 }
133
134
135 @Override
136 public void componentHidden() {
137 }
138
139
140 @Override
141 public void componentActivated() {
142 }
143
144
145 @Override
146 public void componentDeactivated() {
147 }
148
149
150 @Override
151 public UndoRedo getUndoRedo() {
152 return UndoRedo.NONE;
153 }
154
155
156 @Override
157 public void setMultiViewCallback(MultiViewElementCallback callback) {
158 this.callback = callback;
159 }
160
161
162 @Override
163 public CloseOperationState canCloseElement() {
164 return CloseOperationState.STATE_OK;
165 }
166 }