/** * Constructs map with a single key and value pair. * * @param key * The key * @param value * The value */ public MicroMap(final Object key, final Object value) { put(key, value); }
@Override public int size() { return MicroMap.this.size(); } };
/** {@inheritDoc} */ @Override public void onComponentTag(Component component, ComponentTag tag) { String pageIndex = String.valueOf(page + 1).intern(); Map<String, String> vars = new MicroMap<String, String>("page", pageIndex); tag.put("title", PagingNavigation.this.getString(RES, Model.ofMap(vars))); } }
/** {@inheritDoc} */ @Override public void onComponentTag(Component component, ComponentTag tag) { String pageIndex = String.valueOf(page + 1).intern(); Map<String, String> vars = new MicroMap<String, String>("page", pageIndex); tag.put("title", PagingNavigation.this.getString(RES, Model.ofMap(vars))); } }
@Override public String getObject() { return EVENTS.asString(new MicroMap<String, String>("url", getEvents.getUrl(source))); } });
@Override public int size() { return MicroMap.this.size(); } };
/** * Constructs map with a single key and value pair. * * @param key * The key * @param value * The value */ public MicroMap(final K key, final V value) { put(key, value); }
public String getUrl(EventSource source) { return getUrl(new MicroMap<String, Object>(SOURCE_ID, source.getUuid())); }
@Override public int size() { return MicroMap.this.size(); } };
/** * Constructs map with a single key and value pair. * * @param key * The key * @param value * The value */ public MicroMap(final K key, final V value) { put(key, value); }
/** {@inheritDoc} */ @Override public void onComponentTag(Component component, ComponentTag tag) { Map<String, String> vars = new MicroMap<String, String>("page", String.valueOf(page + 1)); tag.put("title", PagingNavigation.this.getString(RES, Model.ofMap(vars))); } }
/** * @return True if this MicroMap is full */ public boolean isFull() { return size() == MAX_ENTRIES; }
/** * @see java.util.Map#putAll(java.util.Map) */ public void putAll(final Map<? extends K, ? extends V> map) { if (map.size() <= MAX_ENTRIES) { final Entry<? extends K, ? extends V> e = map.entrySet().iterator().next(); put(e.getKey(), e.getValue()); } else { throw new IllegalStateException("Map full. Cannot add " + map.size() + " entries"); } }
public String getUrl(EventSource source) { return getUrl(new MicroMap<String, Object>(SOURCE_ID, source.getUuid())); }
/** * @see java.util.Map#isEmpty() */ @Override public boolean isEmpty() { return size() == 0; }
/** * @see java.util.Map#putAll(java.util.Map) */ public void putAll(final Map map) { if (map.size() <= MAX_ENTRIES) { final Map.Entry e = (Map.Entry)map.entrySet().iterator().next(); put(e.getKey(), e.getValue()); } else { throw new IllegalStateException("Map full. Cannot add " + map.size() + " entries"); } }
/** * @see org.apache.wicket.Component#onInitialize() */ @Override protected void onInitialize() { super.onInitialize(); final Form<Void> colorForm = new Form<Void>("colorForm"); add(colorForm); final TextField<String> colorField = new TextField<String>("color", new PropertyModel<String>(this, "selectedColor")); colorField.add(new AjaxFormComponentUpdatingBehavior("change") { private static final long serialVersionUID = 1L; /** * @see org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior#onUpdate(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override protected void onUpdate(final AjaxRequestTarget target) { onColorUpdate(selectedColor); } }); colorForm.add(colorField); // colorpicker js final JavaScriptTemplate jsTemplate = new JavaScriptTemplate( new PackageTextTemplate(ColorPickerPanel.class, "ColorPicker.js.template")); final String javaScript = jsTemplate.asString(new MicroMap<String, String>("markupId", colorField.getMarkupId())); add(new Label("template", javaScript).setEscapeModelStrings(false)); }
/** * @see java.util.Map#isEmpty() */ public boolean isEmpty() { return size() == 0; }
/** * @see java.util.Map#putAll(java.util.Map) */ @Override public void putAll(final Map<? extends K, ? extends V> map) { if (map.size() <= MAX_ENTRIES) { final Entry<? extends K, ? extends V> e = map.entrySet().iterator().next(); put(e.getKey(), e.getValue()); } else { throw new IllegalStateException("Map full. Cannot add " + map.size() + " entries"); } }
@Override public void onSubmit() { if (getContainer().hasNode(fileName)) { error(getString("fileExists", Model.ofMap(new MicroMap<String, String>( "fileName", fileName)))); return; } // create initial node skeleton BrixNode node = (BrixNode) getContainer().addNode(fileName, "nt:file"); BrixFileNode file = BrixFileNode.initialize(node, "text"); // temp-mime // save the node so brix assigns the correct jcr type to it getContainer().save(); // populate node ResourceNode resource = (ResourceNode) getContainer().getSession().getItem( node.getPath()); model.setObject(new BrixNodeModel(resource)); model.apply(); getContainer().save(); // done getSession().info(getString("saved")); SitePlugin.get().selectNode(this, resource, true); } });