當前位置: 首頁>>代碼示例>>Java>>正文


Java PropertyVisibilityHandler類代碼示例

本文整理匯總了Java中org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler的典型用法代碼示例。如果您正苦於以下問題:Java PropertyVisibilityHandler類的具體用法?Java PropertyVisibilityHandler怎麽用?Java PropertyVisibilityHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PropertyVisibilityHandler類屬於org.netbeans.modeler.widget.properties.handler包,在下文中一共展示了PropertyVisibilityHandler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createMapKeyPropertySet

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
protected void createMapKeyPropertySet(ElementPropertySet set){
    Attribute attribute = this.getBaseElementSpec();
    if(!(attribute instanceof MapKeyHandler)){
        throw new IllegalStateException("BaseElementSpec does not implements MapKeyHandler");
    }
    MapKeyHandler mapKeyHandler = (MapKeyHandler)attribute;
    PropertyVisibilityHandler mapKeyVisibilityHandler = getMapKeyVisibilityHandler(attribute);
    set.put("ATTR_PROP", PropertiesHandler.getMapKeyProperty(this, mapKeyHandler, mapKeyVisibilityHandler));
    set.put("ATTR_PROP", PropertiesHandler.getFieldTypeProperty("mapKeyFieldType", "Map Key", "", true, this));
    set.put("COLLECTION_TABLE_PROP", PropertiesHandler.getJoinColumnsProperty("mapKeyJoinColumns", "MapKey Join Columns", "", this.getModelerScene(), mapKeyHandler.getMapKeyJoinColumn()));
    
    
    this.addPropertyChangeListener("mapKeyType",(oldValue, value) -> {
        mapKeyHandler.resetMapAttribute(); 
        AttributeValidator.scanMapKeyHandlerError(this);
        visualizeDataType();
    });
    this.addPropertyVisibilityHandler("mapKeyType", mapKeyVisibilityHandler);
    this.addPropertyVisibilityHandler("mapKeyFieldType", () -> mapKeyVisibilityHandler.isVisible() && mapKeyHandler.getMapKeyType() == MapKeyType.NEW);
    this.addPropertyVisibilityHandler("mapKey", () -> mapKeyVisibilityHandler.isVisible() && mapKeyHandler.getMapKeyType() == MapKeyType.EXT);
    this.addPropertyVisibilityHandler("mapKeyJoinColumns", () -> {
           return mapKeyVisibilityHandler.isVisible() && mapKeyHandler.getMapKeyType() == MapKeyType.NEW && mapKeyHandler.getMapKeyEntity()!=null;
                    }
    );
}
 
開發者ID:jeddict,項目名稱:jeddict,代碼行數:26,代碼來源:AttributeWidget.java

示例2: EntityWidget

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public EntityWidget(IModelerScene scene, NodeWidgetInfo nodeWidgetInfo) {
    super(scene, nodeWidgetInfo);
    this.addPropertyVisibilityHandler("inheritence", new PropertyVisibilityHandler<String>() {
        @Override
        public boolean isVisible() {
            GeneralizationFlowWidget outgoingGeneralizationFlowWidget = EntityWidget.this.getOutgoingGeneralizationFlowWidget();
            List<GeneralizationFlowWidget> incomingGeneralizationFlowWidgets = EntityWidget.this.getIncomingGeneralizationFlowWidgets();
            if (outgoingGeneralizationFlowWidget != null && !(outgoingGeneralizationFlowWidget.getSuperclassWidget() instanceof EntityWidget)) {
                outgoingGeneralizationFlowWidget = null;
            }
            if (outgoingGeneralizationFlowWidget != null || !incomingGeneralizationFlowWidgets.isEmpty()) {
                return true;
            }
            return false;
        }

    });

}
 
開發者ID:foxerfly,項目名稱:Netbeans-JPA-Modeler,代碼行數:20,代碼來源:EntityWidget.java

示例3: PersistenceClassWidget

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public PersistenceClassWidget(IModelerScene scene, NodeWidgetInfo nodeWidgetInfo) {
        super(scene, nodeWidgetInfo);
        this.addPropertyVisibilityHandler("compositePrimaryKeyType", new PropertyVisibilityHandler<String>() {
            @Override
            public boolean isVisible() {
                return PersistenceClassWidget.this.isCompositePKPropertyAllow();
            }
        });
        this.addPropertyVisibilityHandler("compositePrimaryKeyClass", new PropertyVisibilityHandler<String>() {
            @Override
            public boolean isVisible() {
//                if (PersistenceClassWidget.this.getBaseElementSpec() instanceof PrimaryKeyContainer) {
//                    PrimaryKeyContainer primaryKeyContainerSpec = (PrimaryKeyContainer) PersistenceClassWidget.this.getBaseElementSpec();
//                }
                return PersistenceClassWidget.this.isCompositePKPropertyAllow();
            }
        });

    }
 
開發者ID:foxerfly,項目名稱:Netbeans-JPA-Modeler,代碼行數:20,代碼來源:PersistenceClassWidget.java

示例4: createPropertyVisibilityHandler

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public static PropertyVisibilityHandler createPropertyVisibilityHandler(ModelerFile modelerFile, final IBaseElementWidget baseElementWidget, final Object object, final Serializable exp) {
    final IRootElement root = (IRootElement) modelerFile.getModelerScene().getBaseElementSpec();
    return (PropertyVisibilityHandler) () -> {
        Map vars = new HashMap();
        vars.put("root", root);
        vars.put("widget", baseElementWidget);
        vars.put("_this", object);
        vars.put("node", baseElementWidget.getBaseElementSpec());
        return (Boolean) MVEL.executeExpression(exp, vars);
    };
}
 
開發者ID:jeddict,項目名稱:NBModeler,代碼行數:12,代碼來源:PropertySetUtil.java

示例5: ElementCustomPropertySupport

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public ElementCustomPropertySupport(ModelerFile modelerFile, Object object, Class<T> classType,
        String propertyId, String propertyName, String displayName, String description, 
        PropertyChangeListener propertyChangeListener, PropertyVisibilityHandler propertyVisibilityHandler) throws NoSuchMethodException, NoSuchFieldException {
    super(object, classType, propertyName);
    this.modelerFile = modelerFile;
    this.propertyId = propertyId;
    this.classType = classType;
    this.propertyChangeListener = propertyChangeListener;
    this.propertyVisibilityHandler = propertyVisibilityHandler;
    this.setDisplayName(displayName);
    this.setShortDescription(description);

}
 
開發者ID:jeddict,項目名稱:NBModeler,代碼行數:14,代碼來源:ElementCustomPropertySupport.java

示例6: EmbeddedPropertySupport

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public EmbeddedPropertySupport(ModelerFile modelerFile, GenericEmbedded attributeEntity, PropertyVisibilityHandler propertyVisibilityHandler) {
    super(attributeEntity.getName(), Map.class, attributeEntity.getDisplayName(), attributeEntity.getShortDescription(), true, !attributeEntity.isReadOnly());
    this.modelerFile = modelerFile;
    setValue("canEditAsText", Boolean.FALSE);
    this.entity = attributeEntity;
    if (entity.getDataListener() != null) {
        entity.getDataListener().init();
    }
    this.propertyVisibilityHandler = propertyVisibilityHandler;

}
 
開發者ID:jeddict,項目名稱:NBModeler,代碼行數:12,代碼來源:EmbeddedPropertySupport.java

示例7: exploreProperties

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public static void exploreProperties(BasePropertyViewManager node, String displayName, Map<String, PropertyVisibilityHandler> propertyVisibilityHandlerList) {
    node.setDisplayName(displayName);
    node.reloadSheet(propertyVisibilityHandlerList);
    IModelerPanel modelerPanel = node.getModelerScene().getModelerPanelTopComponent();
    if (modelerPanel.getExplorerManager().getRootContext() != node) {
        modelerPanel.getExplorerManager().setRootContext(node);
        try {
            modelerPanel.getExplorerManager().setSelectedNodes(new Node[]{node});
        } catch (PropertyVetoException ex) {
            Exceptions.printStackTrace(ex);
        }
        modelerPanel.setActivatedNodes(new Node[]{node});
    }
}
 
開發者ID:jeddict,項目名稱:NBModeler,代碼行數:15,代碼來源:PropertyUtil.java

示例8: refreshProperties

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public static void refreshProperties(BasePropertyViewManager node, String displayName, Map<String, PropertyVisibilityHandler> propertyVisibilityHandlerList) {
    node.setDisplayName(displayName);
    node.reloadSheet(propertyVisibilityHandlerList);
    IModelerPanel modelerPanel = node.getModelerScene().getModelerPanelTopComponent();
    modelerPanel.getExplorerManager().setRootContext(node);
    try {
        modelerPanel.getExplorerManager().setSelectedNodes(new Node[]{node});
    } catch (PropertyVetoException ex) {
        Exceptions.printStackTrace(ex);
    }
    modelerPanel.setActivatedNodes(new Node[]{node});
}
 
開發者ID:jeddict,項目名稱:NBModeler,代碼行數:13,代碼來源:PropertyUtil.java

示例9: getMapKeyConvertVisibilityHandler

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
private static PropertyVisibilityHandler getMapKeyConvertVisibilityHandler(AttributeWidget<? extends Attribute> attributeWidget, Predicate<MapKeyHandler> filter) {
    PropertyVisibilityHandler mapKeyVisibility = AttributeWidget.getMapKeyVisibilityHandler(attributeWidget.getBaseElementSpec());
    return () -> {
        if (mapKeyVisibility.isVisible()) {
            MapKeyHandler handler = (MapKeyHandler) attributeWidget.getBaseElementSpec();
            return handler.getValidatedMapKeyType() == MapKeyType.NEW && filter.test(handler);
        }
        return false;
    };
}
 
開發者ID:jeddict,項目名稱:jeddict,代碼行數:11,代碼來源:PropertiesHandler.java

示例10: getMapKeyVisibilityHandler

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public static PropertyVisibilityHandler getMapKeyVisibilityHandler(Attribute attribute){
    return () -> {
        if(attribute instanceof CollectionTypeHandler){
            String classname = ((CollectionTypeHandler)attribute).getCollectionType();
                try {
                    return Map.class.isAssignableFrom(Class.forName(classname));
                } catch (ClassNotFoundException ex) { }
        }
        return false;
    };
}
 
開發者ID:jeddict,項目名稱:jeddict,代碼行數:12,代碼來源:AttributeWidget.java

示例11: EntityWidget

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public EntityWidget(JPAModelerScene scene, NodeWidgetInfo nodeWidgetInfo) {
    super(scene, nodeWidgetInfo);
    this.addPropertyChangeListener("abstract", (oldValue, value) -> {
        setImage(getIcon());
        scanDiscriminatorValue();
    });
    PropertyVisibilityHandler overridePropertyHandler = () -> {
        InheritanceStateType inheritanceState = this.getInheritanceState(true);
        return inheritanceState == InheritanceStateType.BRANCH || inheritanceState == InheritanceStateType.LEAF;
    };
    this.addPropertyVisibilityHandler("AttributeOverrides", overridePropertyHandler);
    this.addPropertyVisibilityHandler("AssociationOverrides", overridePropertyHandler);
}
 
開發者ID:jeddict,項目名稱:jeddict,代碼行數:14,代碼來源:EntityWidget.java

示例12: createPropertySet

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public void createPropertySet(IBaseElementWidget baseElementWidget, final Object object,
        final Map<String, PropertyChangeListener> propertyChangeHandlers,
        final Map<String, PropertyVisibilityHandler> propertyVisiblityHandlers) {
    createPropertySet(null,null,baseElementWidget, object, propertyChangeHandlers, propertyVisiblityHandlers, true, false);
}
 
開發者ID:jeddict,項目名稱:NBModeler,代碼行數:6,代碼來源:ElementPropertySet.java

示例13: getPropertyVisibilityHandler

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
/**
 * @return the propertyVisibilityHandler
 */
public PropertyVisibilityHandler getPropertyVisibilityHandler() {
    return propertyVisibilityHandler;
}
 
開發者ID:jeddict,項目名稱:NBModeler,代碼行數:7,代碼來源:ElementCustomPropertySupport.java

示例14: setPropertyVisibilityHandler

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
/**
 * @param propertyVisibilityHandler the propertyVisibilityHandler to set
 */
public void setPropertyVisibilityHandler(PropertyVisibilityHandler propertyVisibilityHandler) {
    this.propertyVisibilityHandler = propertyVisibilityHandler;
}
 
開發者ID:jeddict,項目名稱:NBModeler,代碼行數:7,代碼來源:ElementCustomPropertySupport.java

示例15: ComboBoxPropertySupport

import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler; //導入依賴的package包/類
public ComboBoxPropertySupport(ModelerFile modelerFile, String id, String name, String description, ComboBoxListener comboBoxListener, PropertyVisibilityHandler propertyVisibilityHandler) {
    super(id, ComboBoxValue.class, name, description);
    this.modelerFile = modelerFile;
    this.comboBoxListener = comboBoxListener;
    this.propertyVisibilityHandler = propertyVisibilityHandler;
}
 
開發者ID:jeddict,項目名稱:NBModeler,代碼行數:7,代碼來源:ComboBoxPropertySupport.java


注:本文中的org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。