public static Map<String, String> createInfoAttributes ( final Item item ) { final Map<String, String> attributes = new HashMap<> (); Configurations.fillAttributesWithHierarchy ( attributes, Names.makeHierarchy ( item ) ); attributes.put ( "item", item.getName () ); if ( item.getInformation () != null ) { addAttribute ( attributes, "system", item.getInformation ().getSystem () ); addAttribute ( attributes, "unit", item.getInformation ().getUnit () ); addAttribute ( attributes, "itemDescription", item.getInformation ().getDescription () ); } return attributes; }
public static void registerFeature ( final Item item, final ItemFeatureEntry feature ) { final Iterator<ItemFeatureEntry> i = item.getItemFeatures ().iterator (); while ( i.hasNext () ) { final ItemFeatureEntry entry = i.next (); if ( entry.getName ().equals ( feature.getName () ) ) { i.remove (); } } item.getItemFeatures ().add ( feature ); }
private DataAccessConnection findConnection ( final Item item ) { return Locator.findPossibleConnection ( this.app, (EquinoxApplication)item.eContainer (), DataAccessConnection.class ); }
public static String makeId ( final Item item, final String tag ) { return item.getName () + delimiter + tag; }
protected <T extends Item> T addItem ( final T item, final CustomizationRequest customizationRequest, final Set<MasterListener<T>> masterListeners ) { final List<String> originalLocalTags = new ArrayList<> ( customizationRequest.getLocalTags () ); // we do need a copy customizeItem ( item, customizationRequest ); // set the name after customizing final List<String> hier = new LinkedList<> (); hier.addAll ( customizationRequest.getHierarchy () ); hier.addAll ( customizationRequest.getLocalTags () ); item.setName ( Names.makeHierarchy ( hier ) ); // FIXME: should allow a different naming scheme logger.debug ( "Setting item name: {}", item.getName () ); if ( item.getInformation () == null ) { item.setInformation ( OsgiFactory.eINSTANCE.createItemInformation () ); } // apply the hierarchy afterwards ... overriding! ECollections.setEList ( item.getInformation ().getHierarchy (), customizationRequest.getHierarchy () ); itemAdded ( item, customizationRequest, originalLocalTags, masterListeners ); return item; }
public static List<String> makeHierarchy ( final Item item ) { final ItemInformation info = item.getInformation (); if ( info == null ) { return Collections.emptyList (); } return info.getHierarchy (); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Item getItem () { if ( item != null && item.eIsProxy () ) { InternalEObject oldItem = (InternalEObject)item; item = (Item)eResolveProxy ( oldItem ); if ( item != oldItem ) { if ( eNotificationRequired () ) eNotify ( new ENotificationImpl ( this, Notification.RESOLVE, OsgiPackage.ITEM_REFERENCE__ITEM, oldItem, item ) ); } } return item; }
public CustomizationRequest buildRequest ( final Item item ) { item.setInformation ( this.itemInformation ); return new CustomizationRequest ( this.component, item, this.hierarchy, this.localTags, this.customizationTags, this.globalizationLevel ); }
public static String makeId ( final Item item, final String tag ) { return item.getName () + delimiter + tag; }
protected <T extends Item> T addItem ( final T item, final CustomizationRequest customizationRequest, final Set<MasterListener<T>> masterListeners ) { final List<String> originalLocalTags = new ArrayList<> ( customizationRequest.getLocalTags () ); // we do need a copy customizeItem ( item, customizationRequest ); // set the name after customizing final List<String> hier = new LinkedList<> (); hier.addAll ( customizationRequest.getHierarchy () ); hier.addAll ( customizationRequest.getLocalTags () ); item.setName ( Names.makeHierarchy ( hier ) ); // FIXME: should allow a different naming scheme logger.debug ( "Setting item name: {}", item.getName () ); if ( item.getInformation () == null ) { item.setInformation ( OsgiFactory.eINSTANCE.createItemInformation () ); } // apply the hierarchy afterwards ... overriding! ECollections.setEList ( item.getInformation ().getHierarchy (), customizationRequest.getHierarchy () ); itemAdded ( item, customizationRequest, originalLocalTags, masterListeners ); return item; }
public static List<String> makeHierarchy ( final Item item ) { final ItemInformation info = item.getInformation (); if ( info == null ) { return Collections.emptyList (); } return info.getHierarchy (); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Item getItem () { if ( item != null && item.eIsProxy () ) { InternalEObject oldItem = (InternalEObject)item; item = (Item)eResolveProxy ( oldItem ); if ( item != oldItem ) { if ( eNotificationRequired () ) eNotify ( new ENotificationImpl ( this, Notification.RESOLVE, OsgiPackage.ITEM_EXPORT__ITEM, oldItem, item ) ); } } return item; }
public CustomizationRequest buildRequest ( final Item item ) { item.setInformation ( this.itemInformation ); return new CustomizationRequest ( this.component, item, this.hierarchy, this.localTags, this.customizationTags, this.globalizationLevel ); }
public static Item findMasterItem ( final MasterServer master, final String name ) { // FIXME: speed up for ( final Item item : master.getItems () ) { if ( item.getName ().equals ( name ) ) { return item; } } return null; }
public static Map<String, String> createInfoAttributes ( final Item item ) { final Map<String, String> attributes = new HashMap<> (); Configurations.fillAttributesWithHierarchy ( attributes, Names.makeHierarchy ( item ) ); attributes.put ( "item", item.getName () ); if ( item.getInformation () != null ) { addAttribute ( attributes, "system", item.getInformation ().getSystem () ); addAttribute ( attributes, "unit", item.getInformation ().getUnit () ); addAttribute ( attributes, "itemDescription", item.getInformation ().getDescription () ); } return attributes; }
public boolean isType ( final DataType... dataTypes ) { if ( this.item.getInformation () == null ) { return false; } if ( this.item.getInformation ().getDataType () == null ) { return false; } for ( final DataType dataType : dataTypes ) { if ( this.item.getInformation ().getDataType ().equals ( dataType ) ) { return true; } } return false; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Item getSource () { if ( source != null && source.eIsProxy () ) { InternalEObject oldSource = (InternalEObject)source; source = (Item)eResolveProxy ( oldSource ); if ( source != oldSource ) { if ( eNotificationRequired () ) eNotify ( new ENotificationImpl ( this, Notification.RESOLVE, OsgiPackage.REFERENCE_ITEM__SOURCE, oldSource, source ) ); } } return source; }
public static void registerFeature ( final Item item, final ItemFeatureEntry feature ) { final Iterator<ItemFeatureEntry> i = item.getItemFeatures ().iterator (); while ( i.hasNext () ) { final ItemFeatureEntry entry = i.next (); if ( entry.getName ().equals ( feature.getName () ) ) { i.remove (); } } item.getItemFeatures ().add ( feature ); }
private DataAccessConnection findConnection ( final Item item ) { return Locator.findPossibleConnection ( this.app, (EquinoxApplication)item.eContainer (), DataAccessConnection.class ); }
public static Item findMasterItem ( final MasterServer master, final String name ) { // FIXME: speed up for ( final Item item : master.getItems () ) { if ( item.getName ().equals ( name ) ) { return item; } } return null; }