private void writeHrefAttribute(IXMLElement elem, SVGFigure f) { if (LINK.get(f) != null && LINK.get(f).trim().length() > 0) { elem.setAttribute("href", LINK.get(f)); elem.setAttribute("title", LINK.get(f)); elem.setAttribute("alt", LINK.get(f)); } else { elem.setAttribute("nohref", "true"); } }
public static WorksheetEntry fromParser(XmlPullParser parser) throws XmlPullParserException, IOException { final int depth = parser.getDepth(); final WorksheetEntry entry = new WorksheetEntry(); String tag = null; int type; while (((type = parser.next()) != END_TAG || parser.getDepth() > depth) && type != END_DOCUMENT) { if (type == START_TAG) { tag = parser.getName(); if (LINK.equals(tag)) { final String rel = parser.getAttributeValue(null, REL); final String href = parser.getAttributeValue(null, HREF); if (REL_LISTFEED.equals(rel)) { entry.mListFeed = href; } } } else if (type == END_TAG) { tag = null; } else if (type == TEXT) { final String text = parser.getText(); if (TITLE.equals(tag)) { entry.mTitle = text; } else if (UPDATED.equals(tag)) { entry.mUpdated = ParserUtils.parseTime(text); } } } return entry; }
@Override protected void configure() { install( new GinFactoryModuleBuilder() .implement(new TypeLiteral<PropertyEditor<String>>() {}, StringPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<String>>() {}, named(POSTAL_ADDRESS.name()), StringPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<String>>() {}, named(CATEGORY.name()), StringPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<String>>() {}, named(EMAIL.name()), StringPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<String>>() {}, named(PHONE_NUMBER.name()), StringPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<String>>() {}, named(BLOB_KEY.name()), StringPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<String>>() {}, named("BYTES"), BytesPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<String>>() {}, named(LINK.name()), LinkPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<BlobInfoDto>>() {}, BlobKeyPropertyEditor.class) .implement(new TypeLiteral<PropertyEditor<Long>>() {}, LongPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<Long>>() {}, named("RATING"), RatingPropertyEditor.class) .implement(new TypeLiteral<PropertyEditor<Double>>() {}, DoublePropertyEditor.class) .implement(new TypeLiteral<PropertyEditor<Boolean>>() {}, BooleanPropertyEditor.class) .implement(new TypeLiteral<PropertyEditor<Date>>() {}, DatePropertyEditor.class) .implement(new TypeLiteral<PropertyEditor<GeoPoint>>() {}, GeoPointPropertyEditor.class) .implement(new TypeLiteral<PropertyEditor<IMHandle>>() {}, IMHandlePropertyEditor.class) .implement(new TypeLiteral<PropertyEditor<User>>() {}, UserPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<Map<String, ?>>>() {}, EmbeddedEntityPropertyEditor.class) .implement(new TypeLiteral<PropertyEditor<?>>() {}, RawPropertyEditor.class) .implement(new TypeLiteral<PropertyEditor<Key>>() {}, KeyPropertyEditor.class) .implement( new TypeLiteral<PropertyEditor<Collection<?>>>() {}, CollectionPropertyEditor.class) .build(PropertyEditorsFactory.class)); bind(GeoPointPropertyEditor.Binder.class).in(Singleton.class); install(new GinFactoryModuleBuilder().build(EntityEditorFactory.class)); bind(PropertyEditorCollectionWidgetFactory.class) .to(PropertyEditorCollectionWidgetFactoryImpl.class) .in(Singleton.class); bind(PropertyEditorFactory.class).to(PropertyEditorFactoryImpl.class).in(Singleton.class); bindSharedView(MyView.class, EntityEditorView.class); }
/** * Determines COST of the link. * * @param node * @param link * @return */ protected int getLinkGraphCost(NODE node, LINK link) { return link.getCost(); }