PLSQL/FileType/src/org/netbeans/modules/plsql/filetype/PrototypeVisualElement.java
2 * To change this template, choose Tools | Templates and open the template in
5 package org.netbeans.modules.plsql.filetype;
7 import javax.swing.Action;
8 import javax.swing.JComponent;
9 import javax.swing.JPanel;
10 import javax.swing.JToolBar;
11 import org.netbeans.core.spi.multiview.CloseOperationState;
12 import org.netbeans.core.spi.multiview.MultiViewElement;
13 import org.netbeans.core.spi.multiview.MultiViewElementCallback;
14 import org.openide.awt.UndoRedo;
15 import org.openide.util.Lookup;
16 import org.openide.util.NbBundle.Messages;
17 import org.openide.windows.TopComponent;
19 @MultiViewElement.Registration(displayName = "#LBL_Prototype_VISUAL",
20 iconBase = "SET/PATH/TO/ICON/HERE",
21 mimeType = "text/x-plsql-prototype",
22 persistenceType = TopComponent.PERSISTENCE_NEVER,
23 preferredID = "PrototypeVisual",
26 "LBL_Prototype_VISUAL=Visual"
28 public final class PrototypeVisualElement extends JPanel implements MultiViewElement {
30 private PrototypeDataObject obj;
31 private JToolBar toolbar = new JToolBar();
32 private transient MultiViewElementCallback callback;
34 public PrototypeVisualElement(Lookup lkp) {
35 obj = lkp.lookup(PrototypeDataObject.class);
41 public String getName() {
42 return "PrototypeVisualElement";
45 /** This method is called from within the constructor to
46 * initialize the form.
47 * WARNING: Do NOT modify this code. The content of this method is
48 * always regenerated by the Form Editor.
50 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
51 private void initComponents() {
53 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
54 this.setLayout(layout);
55 layout.setHorizontalGroup(
56 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
57 .addGap(0, 400, Short.MAX_VALUE)
59 layout.setVerticalGroup(
60 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
61 .addGap(0, 300, Short.MAX_VALUE)
63 }// </editor-fold>//GEN-END:initComponents
65 // Variables declaration - do not modify//GEN-BEGIN:variables
66 // End of variables declaration//GEN-END:variables
68 public JComponent getVisualRepresentation() {
73 public JComponent getToolbarRepresentation() {
78 public Action[] getActions() {
83 public Lookup getLookup() {
84 return obj.getLookup();
88 public void componentOpened() {
92 public void componentClosed() {
96 public void componentShowing() {
100 public void componentHidden() {
104 public void componentActivated() {
108 public void componentDeactivated() {
112 public UndoRedo getUndoRedo() {
113 return UndoRedo.NONE;
117 public void setMultiViewCallback(MultiViewElementCallback callback) {
118 this.callback = callback;
122 public CloseOperationState canCloseElement() {
123 return CloseOperationState.STATE_OK;