# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/matthias/NetBeansProjects/core-main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: db/src/org/netbeans/api/db/explorer/node/NodeProvider.java --- db/src/org/netbeans/api/db/explorer/node/NodeProvider.java Base (BASE) +++ db/src/org/netbeans/api/db/explorer/node/NodeProvider.java Locally Modified (Based On LOCAL) @@ -157,7 +157,7 @@ synchronized (nodeSet) { for (Node child : nodeSet) { Object obj = child.getLookup().lookup(dataObject.getClass()); - if (obj.hashCode() == dataObject.hashCode() && obj.equals(dataObject)) { + if (obj != null && obj.hashCode() == dataObject.hashCode() && obj.equals(dataObject)) { results.add(child); } } Index: db/src/org/netbeans/modules/db/explorer/DatabaseConnection.java --- db/src/org/netbeans/modules/db/explorer/DatabaseConnection.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/DatabaseConnection.java Locally Modified (Based On LOCAL) @@ -125,6 +125,10 @@ /** The default schema */ private String defaultSchema = null; + private List importantSchemas = null; + + private List importantDatabases = null; + /** Schema name */ private String schema; @@ -1214,4 +1218,53 @@ return this; } + public List getImportantSchemas() { + if (importantSchemas == null) { + return Collections.emptyList(); + } else { + return Collections.unmodifiableList(importantSchemas); } + } + + public void addImportantSchema(String schema) { + if (importantSchemas == null) { + importantSchemas = new ArrayList(); + } + importantSchemas.add(schema); + } + + public void removeImportantSchema(String schema) { + if (importantSchemas != null) { + importantSchemas.remove(schema); + } + } + + public boolean isImportantSchema(String schema) { + return importantSchemas != null && importantSchemas.contains(schema); + } + + public List getImportantDatabases() { + if (importantDatabases == null) { + return Collections.emptyList(); + } else { + return Collections.unmodifiableList(importantDatabases); + } + } + + public void addImportantDatabase(String database) { + if (importantDatabases == null) { + importantDatabases = new ArrayList(); + } + importantDatabases.add(database); + } + + public void removeImportantDatabase(String database) { + if (importantDatabases != null) { + importantDatabases.remove(database); + } + } + + public boolean isImportantDatabase(String database) { + return importantDatabases != null && importantDatabases.contains(database); + } +} Index: db/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor.java --- db/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/DatabaseConnectionConvertor.java Locally Modified (Based On LOCAL) @@ -58,7 +58,9 @@ import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CoderResult; +import java.util.ArrayList; import java.util.LinkedList; +import java.util.List; import java.util.Map; import java.util.WeakHashMap; import java.util.concurrent.ConcurrentHashMap; @@ -242,6 +244,12 @@ if (handler.displayName != null) { dbconn.setDisplayName(handler.displayName); } + for (String importantSchema : handler.importantSchemas) { + dbconn.addImportantSchema(importantSchema); + } + for (String importantDatabase : handler.importantDatabases) { + dbconn.addImportantDatabase(importantDatabase); + } LOGGER.fine("Created DatabaseConnection[" + dbconn.toString() + "] from file: " + handler.connectionFileName); return dbconn; @@ -395,6 +403,12 @@ if (!instance.getName().equals(instance.getDisplayName())) { pw.println(" "); //NOI18N } + for (String importantSchema : instance.getImportantSchemas()) { + pw.println(" "); //NOI18N + } + for (String importantDatabase : instance.getImportantDatabases()) { + pw.println(" "); //NOI18N + } if (instance.rememberPassword() ) { char[] password = instance.getPassword() == null ? new char[0] : instance.getPassword().toCharArray(); @@ -418,6 +432,8 @@ private static final String ELEMENT_USER = "user"; // NOI18N private static final String ELEMENT_PASSWORD = "password"; // NOI18N private static final String ELEMENT_DISPLAY_NAME = "display-name"; // NOI18N + private static final String ELEMENT_IMPORTANT_SCHEMA = "important-schema"; //NOI18N + private static final String ELEMENT_IMPORTANT_DATABASE = "important-database"; //NOI18N private static final String ATTR_PROPERTY_VALUE = "value"; // NOI18N final String connectionFileName; @@ -428,6 +444,8 @@ String schema; String user; String displayName; + List importantSchemas = new ArrayList(); + List importantDatabases = new ArrayList(); public Handler(String connectionFileName) { this.connectionFileName = connectionFileName; @@ -480,6 +498,10 @@ // no password stored => this will require the user to re-enter the password } } + } else if (ELEMENT_IMPORTANT_SCHEMA.equals(qName)) { + importantSchemas.add(value); + } else if (ELEMENT_IMPORTANT_DATABASE.equals(qName)) { + importantDatabases.add(value); } } } Index: db/src/org/netbeans/modules/db/explorer/action/Bundle.properties --- db/src/org/netbeans/modules/db/explorer/action/Bundle.properties Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/action/Bundle.properties Locally Modified (Based On LOCAL) @@ -60,6 +60,9 @@ ExecuteCommand=Execute Command... MakeDefaultCatalog=Set As Default Catalog MakeDefaultSchema=Set as Default Schema +ToggleImportantAdd=Mark as important +ToggleImportantRemove=Mark as unimportant +ToggleImportant=Toggle important MSG_ViewsAreNotSupported={0} does not support views. Index: db/src/org/netbeans/modules/db/explorer/action/ToggleImportantAction.java --- db/src/org/netbeans/modules/db/explorer/action/ToggleImportantAction.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/action/ToggleImportantAction.java Locally New @@ -0,0 +1,179 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2010 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009-2010 Sun Microsystems, Inc. + */ +package org.netbeans.modules.db.explorer.action; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.logging.Logger; +import org.netbeans.api.db.explorer.DatabaseException; +import org.netbeans.modules.db.explorer.DatabaseConnection; +import org.netbeans.modules.db.explorer.node.ToggleImportantInfo; +import org.netbeans.modules.db.metadata.model.api.Action; +import org.netbeans.modules.db.metadata.model.api.Catalog; +import org.netbeans.modules.db.metadata.model.api.Metadata; +import org.netbeans.modules.db.metadata.model.api.MetadataElement; +import org.netbeans.modules.db.metadata.model.api.MetadataElementHandle; +import org.netbeans.modules.db.metadata.model.api.MetadataModelException; +import org.netbeans.modules.db.metadata.model.api.Schema; +import org.openide.nodes.Node; +import org.openide.util.Exceptions; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; + +/** + * + * @author Jaroslav Havlin + */ +public class ToggleImportantAction extends BaseAction { + + private static final Logger LOGGER = + Logger.getLogger(MakeDefaultCatalogAction.class.getName()); + private String name; + + @Override + public String getName() { + return name; + } + + @Override + protected boolean enable(Node[] activatedNodes) { + boolean toggleImportant = false; + boolean toggleUnImportant = false; + + for(Node node: activatedNodes) { + ToggleImportantInfo tii = node.getLookup().lookup(ToggleImportantInfo.class); + if(tii != null) { + if(! tii.isDefault()) { + if(tii.isImportant()) { + toggleUnImportant = true; + } else { + toggleImportant = true; + } + } + } + } + + if (toggleUnImportant && toggleImportant) { + name = NbBundle.getMessage(ToggleImportantAction.class, + "ToggleImportant"); //NOI18N + return true; + } else if (toggleUnImportant) { + name = NbBundle.getMessage(ToggleImportantAction.class, + "ToggleImportantRemove"); //NOI18N + return true; + } else if (toggleImportant) { + name = name = NbBundle.getMessage( + ToggleImportantAction.class, + "ToggleImportantAdd"); //NOI18N + return true; + } + + return false; + } + + @Override + protected void performAction(final Node[] activatedNodes) { + Set connections = new HashSet(); + + for (Node node : activatedNodes) { + DatabaseConnection conn = node.getLookup().lookup(DatabaseConnection.class); + ToggleImportantInfo tii = node.getLookup().lookup(ToggleImportantInfo.class); + if (conn != null && tii != null && + Catalog.class.isAssignableFrom(tii.getType())) { + String name = node.getName(); + if(name.equals(conn.getDefaultCatalog())) { + tii.setDefault(true); + tii.setImportant(false); + conn.removeImportantDatabase(name); + } else if (! conn.isImportantDatabase(name)) { + conn.addImportantDatabase(name); + tii.setDefault(false); + tii.setImportant(true); + } else { + conn.removeImportantDatabase(name); + tii.setDefault(false); + tii.setImportant(false); + } + connections.add(conn); + } else if (conn != null && tii != null && + Schema.class.isAssignableFrom(tii.getType())) { + String name = node.getName(); + if(name.equals(conn.getDefaultSchema())) { + tii.setDefault(true); + tii.setImportant(false); + conn.removeImportantSchema(name); + } else if (! conn.isImportantDatabase(name)) { + conn.addImportantSchema(name); + tii.setDefault(false); + tii.setImportant(true); + } else { + conn.removeImportantSchema(name); + tii.setDefault(false); + tii.setImportant(false); + } + connections.add(conn); + } + } + + for (DatabaseConnection conn : connections) { + try { + conn.refreshInExplorer(); + conn.notifyChange(); + } catch (DatabaseException ex) { + Exceptions.printStackTrace(ex); + } + } + } + + @Override + public HelpCtx getHelpCtx() { + return null; + } + + private static class ClassContainer { + private Class klazz; + } +} Index: db/src/org/netbeans/modules/db/explorer/node/CatalogNode.java --- db/src/org/netbeans/modules/db/explorer/node/CatalogNode.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/node/CatalogNode.java Locally Modified (Based On LOCAL) @@ -81,16 +81,20 @@ private String htmlName = null; private final DatabaseConnection connection; private final MetadataElementHandle catalogHandle; + private final ToggleImportantInfo toggleImportantInfo = new ToggleImportantInfo( + Catalog.class + ); @SuppressWarnings("unchecked") private CatalogNode(NodeDataLookup lookup, NodeProvider provider) { super(new ChildNodeFactory(lookup), lookup, FOLDER, provider); connection = getLookup().lookup(DatabaseConnection.class); catalogHandle = getLookup().lookup(MetadataElementHandle.class); + lookup.add(toggleImportantInfo); } protected void initialize() { - setupNames(); + refreshMetaData(); connection.addPropertyChangeListener( new PropertyChangeListener() { @@ -103,7 +107,7 @@ ); } - private void setupNames() { + private void refreshMetaData() { MetadataModel metaDataModel = connection.getMetadataModel(); boolean connected = !connection.getConnector().isDisconnected(); if (connected && metaDataModel != null) { @@ -112,6 +116,8 @@ new Action() { public void run(Metadata metaData) { Catalog catalog = catalogHandle.resolve(metaData); + toggleImportantInfo.setDefault(catalog.isDefault()); + toggleImportantInfo.setImportant(connection.isImportantDatabase(name)); renderNames(catalog); } } @@ -124,7 +130,7 @@ @Override protected void updateProperties() { - setupNames(); + refreshMetaData(); super.updateProperties(); } Index: db/src/org/netbeans/modules/db/explorer/node/CatalogNodeProvider.java --- db/src/org/netbeans/modules/db/explorer/node/CatalogNodeProvider.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/node/CatalogNodeProvider.java Locally Modified (Based On LOCAL) @@ -55,8 +55,13 @@ import org.netbeans.modules.db.metadata.model.api.MetadataElementHandle; import org.netbeans.modules.db.metadata.model.api.MetadataModel; import org.netbeans.modules.db.metadata.model.api.MetadataModelException; +import org.netbeans.modules.db.metadata.model.api.Schema; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.ChildFactory; +import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.util.Lookup; +import org.openide.util.NbBundle; /** * @@ -89,6 +94,7 @@ @Override protected synchronized void initialize() { final List newList = new ArrayList(); + final List otherList = new ArrayList(); MetadataModel metaDataModel = connection.getMetadataModel(); boolean isConnected = !connection.getConnector().isDisconnected(); @@ -100,30 +106,20 @@ public void run(Metadata metaData) { Collection catalogs = metaData.getCatalogs(); - String defaultCatalog = metaData.getDefaultCatalog().getName(); - for (Catalog catalog : catalogs) { boolean oneCatalog = catalogs.size() == 1; if (catalog.getName() != null || oneCatalog) { - - boolean use = true; - //if (defaultCatalog != null) { - // use = defaultCatalog.equals(catalog.getName()); - //} - - if (use) { - MetadataElementHandle catalogHandle = MetadataElementHandle.create(catalog); - Collection matches = getNodes(catalogHandle); - if (matches.size() > 0) { - newList.addAll(matches); + if(isDefaultCatalog(catalog, connection)) { + updateNode(newList, catalog); } else { - NodeDataLookup lookup = new NodeDataLookup(); - lookup.add(connection); - lookup.add(catalogHandle); - newList.add(CatalogNode.create(lookup, CatalogNodeProvider.this)); + updateNode(otherList, catalog); } } } + + if (!otherList.isEmpty()) { + newList.add(new CatalogNodeProvider.OtherCatalogsNode ( + otherList)); } if (newList.size() == 1) { @@ -143,11 +139,76 @@ } - static class CatalogComparator implements Comparator { + private boolean isDefaultCatalog(Catalog catalog, + DatabaseConnection connection) { + String def = connection.getDefaultCatalog(); + return (def == null && catalog.isDefault()) + || (def != null && def.equals(catalog.getName()) + || connection.isImportantDatabase(catalog.getName())); + } + + private void updateNode(List newList, Catalog catalog) { + MetadataElementHandle catalogHandle = MetadataElementHandle.create(catalog); + Collection matches = getNodes(catalogHandle); + if (matches != null && matches.size() > 0) { + newList.addAll(matches); + } else { + NodeDataLookup lookup = new NodeDataLookup(); + lookup.add(connection); + lookup.add(catalogHandle); + + newList.add(CatalogNode.create(lookup, this)); + } + } + + static class CatalogComparator implements Comparator { + @Override public int compare(Node node1, Node node2) { + if(node1 instanceof OtherCatalogsNode) { + return 1; + } + if(node2 instanceof OtherCatalogsNode) { + return -1; + } return node1.getDisplayName().compareToIgnoreCase(node2.getDisplayName()); } } + + @NbBundle.Messages({ + "LBL_OtherDatabases=Other databases" + }) + private static class OtherCatalogsNode extends AbstractNode { + + private static final String ICON_BASE = + "org/netbeans/modules/db/resources/database.gif"; //NOI18N + + public OtherCatalogsNode(List otherList) { + super(createChildren(otherList)); + setDisplayName(Bundle.LBL_OtherDatabases()); + setIconBaseWithExtension(ICON_BASE); } + + @Override + public String getName() { + return "zzzzzz"; //NOI18N + } + + private static Children createChildren(final List otherList) { + Children c = Children.create(new ChildFactory() { + @Override + protected boolean createKeys(final List toPopulate) { + toPopulate.addAll(otherList); + return true; + } + + @Override + protected Node createNodeForKey(Node key) { + return key; + } + }, false); + return c; + } + } +} Index: db/src/org/netbeans/modules/db/explorer/node/SchemaNode.java --- db/src/org/netbeans/modules/db/explorer/node/SchemaNode.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/node/SchemaNode.java Locally Modified (Based On LOCAL) @@ -49,6 +49,7 @@ import org.netbeans.api.db.explorer.node.NodeProvider; import org.netbeans.modules.db.explorer.DatabaseConnection; import org.netbeans.modules.db.metadata.model.api.Action; +import org.netbeans.modules.db.metadata.model.api.Catalog; import org.netbeans.modules.db.metadata.model.api.Metadata; import org.netbeans.modules.db.metadata.model.api.MetadataElementHandle; import org.netbeans.modules.db.metadata.model.api.MetadataModel; @@ -82,12 +83,16 @@ private final MetadataElementHandle schemaHandle; private final DatabaseConnection connection; + private final ToggleImportantInfo toggleImportantInfo = new ToggleImportantInfo( + Schema.class + ); @SuppressWarnings("unchecked") private SchemaNode(NodeDataLookup lookup, NodeProvider provider) { super(new ChildNodeFactory(lookup), lookup, FOLDER, provider); connection = getLookup().lookup(DatabaseConnection.class); schemaHandle = getLookup().lookup(MetadataElementHandle.class); + lookup.add(toggleImportantInfo); } @Override @@ -116,6 +121,8 @@ @Override public void run(Metadata metaData) { Schema schema = schemaHandle.resolve(metaData); + toggleImportantInfo.setDefault(schema.isDefault()); + toggleImportantInfo.setImportant(connection.isImportantSchema(name)); renderNames(schema); } } Index: db/src/org/netbeans/modules/db/explorer/node/SchemaNodeProvider.java --- db/src/org/netbeans/modules/db/explorer/node/SchemaNodeProvider.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/node/SchemaNodeProvider.java Locally Modified (Based On LOCAL) @@ -39,7 +39,6 @@ * * Portions Copyrighted 2008 Sun Microsystems, Inc. */ - package org.netbeans.modules.db.explorer.node; import java.util.ArrayList; @@ -56,8 +55,12 @@ import org.netbeans.modules.db.metadata.model.api.MetadataModel; import org.netbeans.modules.db.metadata.model.api.MetadataModelException; import org.netbeans.modules.db.metadata.model.api.Schema; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.ChildFactory; +import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.util.Lookup; +import org.openide.util.NbBundle; /** * @@ -72,6 +75,7 @@ } private static class FactoryHolder { + static final NodeProviderFactory FACTORY = new NodeProviderFactory() { @Override public SchemaNodeProvider createInstance(Lookup lookup) { @@ -80,7 +84,6 @@ } }; } - private final DatabaseConnection connection; private final MetadataElementHandle catalogHandle; @@ -93,6 +96,7 @@ @Override protected synchronized void initialize() { final List newList = new ArrayList(); + final List otherList = new ArrayList(); boolean connected = !connection.getConnector().isDisconnected(); MetadataModel metaDataModel = connection.getMetadataModel(); @@ -111,9 +115,17 @@ } else { Collection schemas = cat.getSchemas(); for (Schema schema : schemas) { + if (isDefaultSchema(schema, connection)) { updateNode(newList, schema); + } else { + updateNode(otherList, schema); } } + if (!otherList.isEmpty()) { + newList.add(new OtherSchemasNode( + otherList)); + } + } if (syntheticSchema != null) { setProxyNodes(newList); @@ -122,8 +134,7 @@ } } } - } - ); + }); } catch (MetadataModelException e) { NodeRegistry.handleMetadataModelException(this.getClass(), connection, e, true); } @@ -132,10 +143,19 @@ } } + private boolean isDefaultSchema(Schema schema, + DatabaseConnection connection) { + + String def = connection.getDefaultSchema(); + return (def == null && schema.isDefault()) + || (def != null && def.equals(schema.getName()) + || connection.isImportantSchema(schema.getName())); + } + private void updateNode(List newList, Schema schema) { MetadataElementHandle schemaHandle = MetadataElementHandle.create(schema); Collection matches = getNodes(schemaHandle); - if (matches.size() > 0) { + if (matches != null && matches.size() > 0) { newList.addAll(matches); } else { NodeDataLookup lookup = new NodeDataLookup(); @@ -152,8 +172,49 @@ public int compare(Node node1, Node node2) { assert node1.getDisplayName() != null : node1 + " has display name."; assert node2.getDisplayName() != null : node2 + " has display name."; + if(node1 instanceof OtherSchemasNode) { + return 1; + } + if(node2 instanceof OtherSchemasNode) { + return -1; + } return node1.getDisplayName().compareToIgnoreCase(node2.getDisplayName()); } + } + @NbBundle.Messages({ + "LBL_OtherSchemas=Other schemas" + }) + private static class OtherSchemasNode extends AbstractNode { + + private static final String ICON_BASE = + "org/netbeans/modules/db/resources/schema.png"; //NOI18N + + public OtherSchemasNode(List otherList) { + super(createChildren(otherList)); + setDisplayName(Bundle.LBL_OtherSchemas()); + setIconBaseWithExtension(ICON_BASE); } + + @Override + public String getName() { + return "zzzzzz"; //NOI18N } + + private static Children createChildren(final List otherList) { + Children c = Children.create(new ChildFactory() { + @Override + protected boolean createKeys(final List toPopulate) { + toPopulate.addAll(otherList); + return true; + } + + @Override + protected Node createNodeForKey(Node key) { + return key; + } + }, false); + return c; + } + } +} Index: db/src/org/netbeans/modules/db/explorer/node/ToggleImportantInfo.java --- db/src/org/netbeans/modules/db/explorer/node/ToggleImportantInfo.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/node/ToggleImportantInfo.java Locally New @@ -0,0 +1,85 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2013 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2013 Sun Microsystems, Inc. + */ +package org.netbeans.modules.db.explorer.node; + +import org.netbeans.modules.db.metadata.model.api.Metadata; +import org.netbeans.modules.db.metadata.model.api.MetadataElement; + +/** + * Represent "important" state for catalogs and schemas + * + * @author matthias + */ +public class ToggleImportantInfo { + private Class type; + private boolean important; + private boolean isDefault; + + public ToggleImportantInfo(Class type) { + this.type = type; + } + + public Class getType() { + return type; + } + + public void setType(Class type) { + this.type = type; + } + + public boolean isImportant() { + return important; + } + + public void setImportant(boolean important) { + this.important = important; + } + + public boolean isDefault() { + return isDefault; + } + + public void setDefault(boolean dflt) { + this.isDefault = dflt; + } + +} Index: db/src/org/netbeans/modules/db/resources/mf-layer.xml --- db/src/org/netbeans/modules/db/resources/mf-layer.xml Base (BASE) +++ db/src/org/netbeans/modules/db/resources/mf-layer.xml Locally Modified (Based On LOCAL) @@ -177,6 +177,9 @@ + + + @@ -204,6 +207,9 @@ + + +