Package org.openquark.cal.services

Examples of org.openquark.cal.services.GemEntity


            } else {
                setIcon(scIcon);
            }

            // Paint non-visible entities in a different color
            GemEntity gemEntity = (GemEntity) treeNode.getUserObject();
            if (!browserTreeModel.isVisibleGem(gemEntity)) {
                setForeground(NON_VISIBLE_COLOR);
            }
           
            // Update the text if we are supposed to show type signatures
            if (browserTree.getDisplayTypeExpr()) {
                ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(browserTreeModel.getPerspective().getWorkingModuleTypeInfo());
                displayString += NAME_TYPE_PAD + gemEntity.getTypeExpr().toString(namingPolicy);
            }

        } else {

            if (isWorkspaceRoot(value)) {
View Full Code Here


     * @return AttributedString
     */
    private AttributedString getAttributedString() {
       
        AttributedString theString = new AttributedString(getText());
        GemEntity gemEntity = (GemEntity) treeNode.getUserObject();
        Color foreground = (selected) ? getTextSelectionColor() : getTextNonSelectionColor();
       
        if (browserTreeModel.isVisibleGem(gemEntity)) {
            theString.addAttribute(TextAttribute.FOREGROUND, foreground);
        } else {
View Full Code Here

        if (isGemNode(treeNode) && browserTree.getDisplayTypeExpr()) {
            // If required draw type signatures next to gem names in a different font.
           
            stylizedName = getAttributedString();
           
            GemEntity gemEntity = (GemEntity) treeNode.getUserObject();               
            ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(browserTreeModel.getPerspective().getWorkingModuleTypeInfo());
            int nameLength = treeNode.getDisplayedString().length() + NAME_TYPE_PAD.length();
            int typeLength = gemEntity.getTypeExpr().toString(namingPolicy).length();
           
            // Make the type name appear in italic and in a smaller size
            stylizedName.addAttribute(TextAttribute.FONT, getFont().deriveFont(Font.ITALIC), nameLength, nameLength + typeLength);
           
            if (browserTreeModel.isVisibleGem(gemEntity)) {
View Full Code Here

     */
    private boolean isDataConstructor(Object value) {

        if (value instanceof BrowserTreeNode) {
            BrowserTreeNode gem = (BrowserTreeNode)value;
            GemEntity gemEntity = (GemEntity)gem.getUserObject();
            return gemEntity.isDataConstructor();
        }  
        return false;
    }
View Full Code Here

                       
            // Add the entity nodes to the category node.
            List<GemEntity> categoryItems = category.getCategoryItems();
            int numEntities = categoryItems.size();
            for (int j = 0; j < numEntities; j++) {
                GemEntity gemEntity = categoryItems.get(j);
                if (selectedNode instanceof SearchResultRootTreeNode) {
                    categoryNode.add(new SearchResultGemTreeNode(gemEntity, workingModuleTypeInfo));
                } else {
                    GemTreeNode node = new GemTreeNode(gemEntity, workingModuleTypeInfo);
                    categoryNode.add(node);
View Full Code Here

        // Add the entity nodes in the correct sorting order
        int numEntities = sortedList.size();
        for (int j = 0; j < numEntities; j++) {
           
            GemEntity gemEntity = sortedList.get(j);
           
            if (selectedNode instanceof SearchResultRootTreeNode) {
                selectedNode.add(new SearchResultGemTreeNode(gemEntity, perspective.getWorkingModuleTypeInfo()));
            } else {
                GemTreeNode node = new GemTreeNode(gemEntity, perspective.getWorkingModuleTypeInfo());
View Full Code Here

                    @Override
                    void doAction() {
                       
                        final NavAddress address;
                        if (selectedNode instanceof GemTreeNode) {
                            GemEntity gemEntity = (GemEntity) selectedNode.getUserObject();
                            address = NavAddress.getAddress(gemEntity);
                            browserTree.getNavigatorOwner().editMetadata(address);
                       
                        } else if (selectedNode instanceof GemDrawer) {
                            final GemDrawer gemDrawer = (GemDrawer) selectedNode;
View Full Code Here

                    @Override
                    void doAction() {

                        final NavAddress address;
                        if (selectedNode instanceof GemTreeNode) {
                            GemEntity gemEntity = (GemEntity) selectedNode.getUserObject();
                            address = NavAddress.getAddress(gemEntity);
                            browserTree.getNavigatorOwner().displayMetadata(address, true);
                       
                        } else if (selectedNode instanceof GemDrawer) {
                            final GemDrawer gemDrawer = (GemDrawer) selectedNode;
View Full Code Here

     * @see org.openquark.gems.client.browser.BrowserTreeNode#getDisplayedString()
     */
    @Override
    public String getDisplayedString() {
       
        GemEntity gemEntity = (GemEntity)getUserObject();
       
        if (getParent() instanceof GemDrawer) {
            // If this node is inside its module's folder, just show the unqualified name.
            return gemEntity.getAdaptedName(ScopedEntityNamingPolicy.UNQUALIFIED);
       
        } else {
            ScopedEntityNamingPolicy namingPolicy = new UnqualifiedUnlessAmbiguous(currentModuleTypeInfo);
            return gemEntity.getAdaptedName(namingPolicy);
        }
    }
View Full Code Here

     * the GemEntity and calling hasDesign() on it, because this method uses a cached value
     * whereas GemEntity.hasDesign() computes the value by looking in the gemDesign store,
     * which can be expensive.
     */
    public boolean hasDesign() {
        GemEntity gemEntity = (GemEntity)getUserObject();
        return gemEntity.hasDesign();
    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.services.GemEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.