当前位置: 首页>>代码示例>>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;未经允许,请勿转载。