Java Code Examples for org.openide.nodes.AbstractNode#setShortDescription()
The following examples show how to use
org.openide.nodes.AbstractNode#setShortDescription() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigurationsNode.java From netbeans with Apache License 2.0 | 6 votes |
@Override protected Node createNodeForKey(GradleConfiguration conf) { AbstractNode ret = new AbstractNode(Children.create(new ConfigurationChildren(project, conf.getName()), true)); ret.setName(conf.getName()); ret.setShortDescription(conf.getDescription()); StringBuilder displayName = new StringBuilder(conf.getName()); if (!conf.getExtendsFrom().isEmpty()) { displayName.append(" ["); String separator = ""; for (GradleConfiguration ext : conf.getExtendsFrom()) { displayName.append(separator); displayName.append(ext.getName()); separator = ", "; } displayName.append(']'); } ret.setDisplayName(displayName.toString()); ret.setIconBaseWithExtension(LIBRARIES_ICON); return ret; }
Example 2
Source File: Util.java From netbeans with Apache License 2.0 | 5 votes |
public static Node createInfoNode() { AbstractNode n = new AbstractNode(Children.LEAF); n.setName(NbBundle.getMessage(WildflyItemNode.class, "LBL_InfoNode_DisplayName")); //NOI18N n.setShortDescription(NbBundle.getMessage(WildflyItemNode.class, "LBL_InfoNode_ToolTip")); //NOI18N n.setIconBaseWithExtension("org/netbeans/core/resources/exception.gif"); // NOI18N return n; }
Example 3
Source File: Util.java From netbeans with Apache License 2.0 | 5 votes |
public static Node createInfoNode() { AbstractNode n = new AbstractNode(Children.LEAF); n.setName(NbBundle.getMessage(JBItemNode.class, "LBL_InfoNode_DisplayName")); //NOI18N n.setShortDescription(NbBundle.getMessage(JBItemNode.class, "LBL_InfoNode_ToolTip")); //NOI18N n.setIconBaseWithExtension("org/netbeans/core/resources/exception.gif"); // NOI18N return n; }
Example 4
Source File: VariablesPanel.java From netbeans with Apache License 2.0 | 5 votes |
protected Node[] createNodes(Variable var) { Children ch = Children.LEAF; AbstractNode n = new AbstractNode(ch, Lookups.singleton(var)) { @Override public Image getIcon(int type) { return iconDelegate.getIcon(type); } }; n.setName(var.getName()); n.setDisplayName(var.getName() + "("+var.getValue().getPath()+")"); // NOI18N n.setShortDescription(var.getName() + "("+var.getValue().getPath()+")"); // NOI18N return new Node[] {n}; }
Example 5
Source File: EntityChildFactory.java From jeddict with Apache License 2.0 | 5 votes |
@Override protected Node createNodeForKey(EntityWidget entityWidget) { AbstractNode node = new AttributeRootNode(Children.create(new AttributeChildFactory(entityWidget), true)) { @Override public Action[] getActions(boolean context) { Action[] result = new Action[]{ SystemAction.get(DeleteAction.class), SystemAction.get(PropertiesAction.class) }; return result; } @Override public boolean canDestroy() { EntityWidget customer = this.getLookup().lookup(EntityWidget.class); return customer != null; } @Override public void destroy() throws IOException { // if (deleteEntity(this.getLookup().lookup(Entity.class).getEntityId())) { // super.destroy(); // EntityTopComponent.refreshNode(); // } } }; node.setDisplayName(entityWidget.getNodeName()); node.setShortDescription(entityWidget.getNodeName()); node.setIconBaseWithExtension(entityWidget.getIconPath()); return node; }
Example 6
Source File: OverrideAttributeChildFactory.java From jeddict with Apache License 2.0 | 5 votes |
@Override protected Node createNodeForKey(final AttributeWidget attributeWidget) { Attribute attribute = (Attribute) attributeWidget.getBaseElementSpec(); AbstractNode node; if (attributeWidget instanceof EmbeddedAttributeWidget) { EmbeddedAttributeWidget embeddedAttributeWidget = (EmbeddedAttributeWidget) attributeWidget; node = new OverrideEmbeddedRootNode(Children.create(new OverrideEmbeddedAttributeChildFactory(entityWidget, "", embeddedAttributeWidget, embeddedAttributeWidget.getEmbeddableFlowWidget().getTargetEmbeddableWidget()), true)); } else { node = new PropertyNode(entityWidget.getModelerScene(), Children.LEAF) { @Override public void createPropertySet(ElementPropertySet set) { if (entityWidget.getBaseElementSpec() instanceof AttributeOverrideHandler) { Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec(); AttributeOverrideHandler attributeOverrideHandler = (AttributeOverrideHandler) entityWidget.getBaseElementSpec(); AttributeOverride attributeOverride = attributeOverrideHandler.getAttributeOverride(attributeSpec.getName()); set.createPropertySet(attributeWidget, attributeOverride.getColumn(), attributeWidget.getPropertyChangeListeners(), attributeWidget.getPropertyVisibilityHandlers()); } } }; } node.setDisplayName(attribute.getName()); node.setShortDescription(attribute.getName()); node.setIconBaseWithExtension(attributeWidget.getIconPath()); return node; }
Example 7
Source File: OverrideEmbeddedAttributeChildFactory.java From jeddict with Apache License 2.0 | 5 votes |
@Override protected Node createNodeForKey(final AttributeWidget attributeWidget) { Attribute attribute = (Attribute) attributeWidget.getBaseElementSpec(); AbstractNode node = null; if (attributeWidget instanceof EmbeddedAttributeWidget) { EmbeddedAttributeWidget embeddedAttributeWidget = (EmbeddedAttributeWidget) attributeWidget; Attribute attributeSpec = (Attribute) embeddedAttributeWidget.getBaseElementSpec(); //May be Embedded or ElementCollection ( for multi Embedded ) String prefixAttributePath_Tmp; if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) { prefixAttributePath_Tmp = attributeSpec.getName(); } else { prefixAttributePath_Tmp = prefixAttributePath + "." + attributeSpec.getName(); } node = new OverrideEmbeddedRootNode(Children.create(new OverrideEmbeddedAttributeChildFactory(entityWidget, prefixAttributePath_Tmp, initialAttributeWidget, embeddedAttributeWidget.getEmbeddableFlowWidget().getTargetEmbeddableWidget()), true)); } else { node = new PropertyNode(entityWidget.getModelerScene(), Children.LEAF) { @Override public void createPropertySet(ElementPropertySet set) { if (initialAttributeWidget.getBaseElementSpec() instanceof AttributeOverrideHandler) { Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec(); AttributeOverrideHandler attributeOverrideHandler = (AttributeOverrideHandler) initialAttributeWidget.getBaseElementSpec(); AttributeOverride attributeOverride = null; if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) { attributeOverride = attributeOverrideHandler.getAttributeOverride(attributeSpec.getName()); } else { attributeOverride = attributeOverrideHandler.getAttributeOverride(prefixAttributePath + "." + attributeSpec.getName()); } set.createPropertySet(attributeWidget, attributeOverride.getColumn(), attributeWidget.getPropertyChangeListeners(), attributeWidget.getPropertyVisibilityHandlers()); } } }; } node.setDisplayName(attribute.getName()); node.setShortDescription(attribute.getName()); node.setIconBaseWithExtension(attributeWidget.getIconPath()); return node; }
Example 8
Source File: OverrideAllChildFactory.java From jeddict with Apache License 2.0 | 5 votes |
@Override protected Node createNodeForKey(final AttributeWidget attributeWidget) { Attribute attribute = (Attribute) attributeWidget.getBaseElementSpec(); AbstractNode node; if (attributeWidget instanceof EmbeddedAttributeWidget) { EmbeddedAttributeWidget embeddedAttributeWidget = (EmbeddedAttributeWidget) attributeWidget; node = new OverrideEmbeddedRootNode(Children.create(new OverrideEmbeddedAllChildFactory(entityWidget, "", embeddedAttributeWidget, embeddedAttributeWidget.getEmbeddableFlowWidget().getTargetEmbeddableWidget()), true)); } else { node = new PropertyNode<JPAModelerScene>(entityWidget.getModelerScene(), Children.LEAF) { @Override public void createPropertySet(ElementPropertySet set) { if (attributeWidget instanceof RelationAttributeWidget && entityWidget.getBaseElementSpec() instanceof AssociationOverrideHandler) { Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec(); AssociationOverrideHandler associationOverrideHandler = (AssociationOverrideHandler) entityWidget.getBaseElementSpec(); AssociationOverride associationOverride = associationOverrideHandler.getAssociationOverride(attributeSpec.getName()); if (attributeSpec instanceof JoinColumnHandler) { set.put("JOIN_COLUMN_PROP", PropertiesHandler.getJoinColumnsProperty("JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinColumn())); } set.createPropertySet(attributeWidget, associationOverride.getJoinTable()); set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getJoinColumn())); set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_InverseJoinColumns", "Inverse Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getInverseJoinColumn())); } else if (entityWidget.getBaseElementSpec() instanceof AttributeOverrideHandler) { Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec(); AttributeOverrideHandler attributeOverrideHandler = (AttributeOverrideHandler) entityWidget.getBaseElementSpec(); AttributeOverride attributeOverride = attributeOverrideHandler.getAttributeOverride(attributeSpec.getName()); set.createPropertySet(attributeWidget, attributeOverride.getColumn(), attributeWidget.getPropertyChangeListeners(), attributeWidget.getPropertyVisibilityHandlers()); } } }; } node.setDisplayName(attribute.getName()); node.setShortDescription(attribute.getName()); node.setIconBaseWithExtension(attributeWidget.getIconPath()); return node; }
Example 9
Source File: OverrideAssociationChildFactory.java From jeddict with Apache License 2.0 | 5 votes |
@Override protected Node createNodeForKey(final AttributeWidget attributeWidget) { Attribute attribute = (Attribute) attributeWidget.getBaseElementSpec(); AbstractNode node; if (attributeWidget instanceof EmbeddedAttributeWidget) { EmbeddedAttributeWidget embeddedAttributeWidget = (EmbeddedAttributeWidget) attributeWidget; node = new OverrideEmbeddedRootNode(Children.create(new OverrideEmbeddedAssociationChildFactory(entityWidget, "", embeddedAttributeWidget, embeddedAttributeWidget.getEmbeddableFlowWidget().getTargetEmbeddableWidget()), true)); } else { node = new PropertyNode<JPAModelerScene>(entityWidget.getModelerScene(), Children.LEAF) { @Override public void createPropertySet(ElementPropertySet set) { if (entityWidget.getBaseElementSpec() instanceof AssociationOverrideHandler) { Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec(); AssociationOverrideHandler associationOverrideHandler = (AssociationOverrideHandler) entityWidget.getBaseElementSpec(); AssociationOverride associationOverride = associationOverrideHandler.getAssociationOverride(attributeSpec.getName()); if (attributeSpec instanceof JoinColumnHandler) { set.put("JOIN_COLUMN_PROP", PropertiesHandler.getJoinColumnsProperty("JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinColumn())); } set.createPropertySet(attributeWidget, associationOverride.getJoinTable()); set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getJoinColumn())); set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_InverseJoinColumns", "Inverse Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getInverseJoinColumn())); } } }; } node.setDisplayName(attribute.getName()); node.setShortDescription(attribute.getName()); node.setIconBaseWithExtension(attributeWidget.getIconPath()); return node; }
Example 10
Source File: LayoutLaunchingPanel.java From netbeans with Apache License 2.0 | 4 votes |
@Override @NbBundle.Messages({ "LBL_NoModesFound=No layout definition found", "MSG_NoModesFound=Is everything OK? Did your application compile and run?" }) public void taskFinished(Task task) { handle.finish(); FileObject modeDir = userDir.get().getFileObject("config/Windows2Local/Modes"); boolean one = false; final Children ch = getExplorerManager().getRootContext().getChildren(); if (modeDir != null) { try { FileSystem layer = DesignSupport.findLayer(data.getProject()); if (layer == null) { throw new IOException("Cannot find layer in " + data.getProject()); // NOI18N } data.setSFS(layer); for (FileObject m : modeDir.getChildren()) { if (m.isData() && "wsmode".equals(m.getExt())) { ModeNode mn = new ModeNode(m, data); ch.add(new Node[] { mn }); one = true; } } } catch (IOException ex) { Exceptions.printStackTrace(ex); } } if (!one) { AbstractNode empty = new AbstractNode(Children.LEAF); empty.setName("empty"); // NOI18N empty.setDisplayName(Bundle.LBL_NoModesFound()); empty.setShortDescription(Bundle.MSG_NoModesFound()); ch.add(new Node[] { empty }); markInvalid(); } else { markValid(); } EventQueue.invokeLater(this); }
Example 11
Source File: AttributeChildFactory.java From jeddict with Apache License 2.0 | 4 votes |
@Override protected Node createNodeForKey(final ColumnDef columnDef) { AbstractNode node = new PropertyNode(columnDef.getAttributeWidget().getModelerScene(), Children.LEAF, Lookups.singleton(columnDef)) { @Override public void createPropertySet(ElementPropertySet set) { if (columnDef.getAttributeWidget().getBaseElementSpec() instanceof PersistenceBaseAttribute) { PersistenceBaseAttribute persistenceBaseAttribute = (PersistenceBaseAttribute) columnDef.getAttributeWidget().getBaseElementSpec(); if (persistenceBaseAttribute.getColumn() == null) { persistenceBaseAttribute.setColumn(new Column()); } set.createPropertySet(columnDef.getAttributeWidget(), persistenceBaseAttribute.getColumn(), columnDef.getAttributeWidget().getPropertyChangeListeners(), columnDef.getAttributeWidget().getPropertyVisibilityHandlers()); } } @Override public Action[] getActions(boolean context) { Action[] result = new Action[]{ SystemAction.get(DeleteAction.class), SystemAction.get(PropertiesAction.class) }; return result; } @Override public boolean canDestroy() { Entity customer = this.getLookup().lookup(Entity.class); return customer != null; } @Override public void destroy() throws IOException { // if (deleteEntity(this.getLookup().lookup(Entity.class).getEntityId())) { // super.destroy(); // EntityTopComponent.refreshNode(); // } } }; node.setDisplayName(columnDef.getFlowTitle() + " -> " + columnDef.getColumnName()); node.setShortDescription(columnDef.getColumnName()); AttributeWidget attributeWidget = columnDef.getAttributeWidget(); node.setIconBaseWithExtension(attributeWidget.getIconPath()); return node; }
Example 12
Source File: OverrideEmbeddedAllChildFactory.java From jeddict with Apache License 2.0 | 4 votes |
@Override protected Node createNodeForKey(final AttributeWidget attributeWidget) { Attribute attribute = (Attribute) attributeWidget.getBaseElementSpec(); AbstractNode node = null; if (attributeWidget instanceof EmbeddedAttributeWidget) { EmbeddedAttributeWidget embeddedAttributeWidget = (EmbeddedAttributeWidget) attributeWidget; Attribute attributeSpec = (Attribute) embeddedAttributeWidget.getBaseElementSpec(); //May be Embedded or ElementCollection ( for multi Embedded ) String prefixAttributePath_Tmp; if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) { prefixAttributePath_Tmp = attributeSpec.getName(); } else { prefixAttributePath_Tmp = prefixAttributePath + "." + attributeSpec.getName(); } node = new OverrideEmbeddedRootNode(Children.create(new OverrideEmbeddedAllChildFactory(entityWidget, prefixAttributePath_Tmp, initialAttributeWidget, embeddedAttributeWidget.getEmbeddableFlowWidget().getTargetEmbeddableWidget()), true)); } else { node = new PropertyNode<JPAModelerScene>(entityWidget.getModelerScene(), Children.LEAF) { @Override public void createPropertySet(ElementPropertySet set) { if (attributeWidget instanceof RelationAttributeWidget && initialAttributeWidget.getBaseElementSpec() instanceof AssociationOverrideHandler) { Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec(); AssociationOverrideHandler associationOverrideHandler = (AssociationOverrideHandler) initialAttributeWidget.getBaseElementSpec(); AssociationOverride associationOverride = null; if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) { associationOverride = associationOverrideHandler.getAssociationOverride(attributeSpec.getName()); } else { associationOverride = associationOverrideHandler.getAssociationOverride(prefixAttributePath + "." + attributeSpec.getName()); } if (attributeSpec instanceof JoinColumnHandler) { set.put("JOIN_COLUMN_PROP", PropertiesHandler.getJoinColumnsProperty("JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinColumn())); } set.createPropertySet(attributeWidget, associationOverride.getJoinTable()); set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getJoinColumn())); set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_InverseJoinColumns", "Inverse Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getInverseJoinColumn())); } else if (initialAttributeWidget.getBaseElementSpec() instanceof AttributeOverrideHandler) { Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec(); AttributeOverrideHandler attributeOverrideHandler = (AttributeOverrideHandler) initialAttributeWidget.getBaseElementSpec(); AttributeOverride attributeOverride = null; if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) { attributeOverride = attributeOverrideHandler.getAttributeOverride(attributeSpec.getName()); } else { attributeOverride = attributeOverrideHandler.getAttributeOverride(prefixAttributePath + "." + attributeSpec.getName()); } set.createPropertySet(attributeWidget, attributeOverride.getColumn(), attributeWidget.getPropertyChangeListeners(), attributeWidget.getPropertyVisibilityHandlers()); } } }; } node.setDisplayName(attribute.getName()); node.setShortDescription(attribute.getName()); node.setIconBaseWithExtension(attributeWidget.getIconPath()); return node; }
Example 13
Source File: OverrideEmbeddedAssociationChildFactory.java From jeddict with Apache License 2.0 | 4 votes |
@Override protected Node createNodeForKey(final AttributeWidget attributeWidget) { Attribute attribute = (Attribute) attributeWidget.getBaseElementSpec(); AbstractNode node = null; if (attributeWidget instanceof EmbeddedAttributeWidget) { EmbeddedAttributeWidget embeddedAttributeWidget = (EmbeddedAttributeWidget) attributeWidget; Attribute attributeSpec = (Attribute) embeddedAttributeWidget.getBaseElementSpec(); //May be Embedded or ElementCollection ( for multi Embedded ) String prefixAttributePath_Tmp; if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) { prefixAttributePath_Tmp = attributeSpec.getName(); } else { prefixAttributePath_Tmp = prefixAttributePath + "." + attributeSpec.getName(); } node = new OverrideEmbeddedRootNode(Children.create(new OverrideEmbeddedAssociationChildFactory(entityWidget, prefixAttributePath_Tmp, initialAttributeWidget, embeddedAttributeWidget.getEmbeddableFlowWidget().getTargetEmbeddableWidget()), true)); } else { node = new PropertyNode<JPAModelerScene>(entityWidget.getModelerScene(), Children.LEAF) { @Override public void createPropertySet(ElementPropertySet set) { if (initialAttributeWidget.getBaseElementSpec() instanceof AssociationOverrideHandler) { Attribute attributeSpec = (Attribute) attributeWidget.getBaseElementSpec(); AssociationOverrideHandler associationOverrideHandler = (AssociationOverrideHandler) initialAttributeWidget.getBaseElementSpec(); AssociationOverride associationOverride = null; if (prefixAttributePath == null || prefixAttributePath.trim().isEmpty()) { associationOverride = associationOverrideHandler.getAssociationOverride(attributeSpec.getName()); } else { associationOverride = associationOverrideHandler.getAssociationOverride(prefixAttributePath + "." + attributeSpec.getName()); } if (attributeSpec instanceof JoinColumnHandler) { set.put("JOIN_COLUMN_PROP", PropertiesHandler.getJoinColumnsProperty("JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinColumn())); } set.createPropertySet(attributeWidget, associationOverride.getJoinTable()); set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_JoinColumns", "Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getJoinColumn())); set.put("JOIN_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("JoinTable_InverseJoinColumns", "Inverse Join Columns", "", this.getModelerScene(), associationOverride.getJoinTable().getInverseJoinColumn())); } } }; } node.setDisplayName(attribute.getName()); node.setShortDescription(attribute.getName()); node.setIconBaseWithExtension(attributeWidget.getIconPath()); return node; }