Lines 61-71
Link Here
|
61 |
*/ |
61 |
*/ |
62 |
public class TableListNode extends BaseNode implements SchemaNameProvider { |
62 |
public class TableListNode extends BaseNode implements SchemaNameProvider { |
63 |
private static final String NAME = "Tables"; // NOI18N |
63 |
private static final String NAME = "Tables"; // NOI18N |
|
|
64 |
private static final String SYSTEM_NAME = "SystemTables"; // NOI18N |
64 |
private static final String ICONBASE = "org/netbeans/modules/db/resources/folder.gif"; // NOI18N |
65 |
private static final String ICONBASE = "org/netbeans/modules/db/resources/folder.gif"; // NOI18N |
65 |
private static final String FOLDER = "TableList"; //NOI18N |
66 |
private static final String FOLDER = "TableList"; //NOI18N |
|
|
67 |
private static final String SYSTEM_FOLDER = "SystemTableList"; //NOI18N |
66 |
|
68 |
|
67 |
private MetadataElementHandle<Schema> schemaHandle; |
69 |
private MetadataElementHandle<Schema> schemaHandle; |
68 |
private final DatabaseConnection connection; |
70 |
private final DatabaseConnection connection; |
|
|
71 |
private final boolean system; |
69 |
|
72 |
|
70 |
/** |
73 |
/** |
71 |
* Create an instance of TableListNode. |
74 |
* Create an instance of TableListNode. |
Lines 73-87
Link Here
|
73 |
* @param dataLookup the lookup to use when creating node providers |
76 |
* @param dataLookup the lookup to use when creating node providers |
74 |
* @return the TableListNode instance |
77 |
* @return the TableListNode instance |
75 |
*/ |
78 |
*/ |
76 |
public static TableListNode create(NodeDataLookup dataLookup, NodeProvider provider) { |
79 |
public static TableListNode create(NodeDataLookup dataLookup, NodeProvider provider, boolean system) { |
77 |
TableListNode node = new TableListNode(dataLookup, provider); |
80 |
TableListNode node = new TableListNode(dataLookup, provider, system); |
78 |
node.setup(); |
81 |
node.setup(); |
79 |
return node; |
82 |
return node; |
80 |
} |
83 |
} |
81 |
|
84 |
|
82 |
private TableListNode(NodeDataLookup lookup, NodeProvider provider) { |
85 |
private TableListNode(NodeDataLookup lookup, NodeProvider provider, boolean system) { |
83 |
super(new ChildNodeFactory(lookup), lookup, FOLDER, provider); |
86 |
super(new ChildNodeFactory(lookup), lookup, system ? SYSTEM_FOLDER : FOLDER, provider); |
84 |
connection = getLookup().lookup(DatabaseConnection.class); |
87 |
this.connection = getLookup().lookup(DatabaseConnection.class); |
|
|
88 |
this.system = system; |
85 |
} |
89 |
} |
86 |
|
90 |
|
87 |
@SuppressWarnings("unchecked") |
91 |
@SuppressWarnings("unchecked") |
Lines 91-103
Link Here
|
91 |
|
95 |
|
92 |
@Override |
96 |
@Override |
93 |
public String getName() { |
97 |
public String getName() { |
|
|
98 |
if(system) { |
94 |
return NAME; |
99 |
return NAME; |
|
|
100 |
} else { |
101 |
return SYSTEM_NAME; |
95 |
} |
102 |
} |
|
|
103 |
} |
96 |
|
104 |
|
97 |
@Override |
105 |
@Override |
98 |
public String getDisplayName() { |
106 |
public String getDisplayName() { |
|
|
107 |
if(system) { |
108 |
return NbBundle.getMessage (TableListNode.class, "SystemTableListNode_DISPLAYNAME"); // NOI18N |
109 |
} else { |
99 |
return NbBundle.getMessage (TableListNode.class, "TableListNode_DISPLAYNAME"); // NOI18N |
110 |
return NbBundle.getMessage (TableListNode.class, "TableListNode_DISPLAYNAME"); // NOI18N |
100 |
} |
111 |
} |
|
|
112 |
} |
101 |
|
113 |
|
102 |
@Override |
114 |
@Override |
103 |
public String getIconBase() { |
115 |
public String getIconBase() { |
Lines 106-113
Link Here
|
106 |
|
118 |
|
107 |
@Override |
119 |
@Override |
108 |
public String getShortDescription() { |
120 |
public String getShortDescription() { |
|
|
121 |
if(system) { |
122 |
return NbBundle.getMessage (TableListNode.class, "ND_SystemTableList"); //NOI18N |
123 |
} else { |
109 |
return NbBundle.getMessage (TableListNode.class, "ND_TableList"); //NOI18N |
124 |
return NbBundle.getMessage (TableListNode.class, "ND_TableList"); //NOI18N |
110 |
} |
125 |
} |
|
|
126 |
} |
111 |
|
127 |
|
112 |
@Override |
128 |
@Override |
113 |
public HelpCtx getHelpCtx() { |
129 |
public HelpCtx getHelpCtx() { |