/** * Create an external resource binding. * * @param aKey * the key to bind to. * @param aResourceKey * the resource key to bind. * @return the description. */ public static ExternalResourceBinding createExternalResourceBinding(final String aKey, final String aResourceKey) { ExternalResourceBinding extResBind = new ExternalResourceBinding_impl(); extResBind.setResourceName(aResourceKey); extResBind.setKey(aKey); return extResBind; }
/** * Propagate key change. * * @param newKey the new key * @param oldKey the old key */ private void propagateKeyChange(String newKey, String oldKey) { ExternalResourceBinding[] xrb = getExternalResourceBindings(); if (null != xrb) for (int i = 0; i < xrb.length; i++) { if (oldKey.equals(xrb[i].getKey())) { xrb[i].setKey(newKey); editor.getResourcesPage().getResourceBindingsSection().markStale(); return; // only 1 binding at most } } }
bindNestedResources(nestedRes, aBindings, aResources); b.setKey(key);
bindNestedResources(nestedRes, aBindings, aResources); b.setKey(key);
/** * Bind button - enabled only when one dependency is selected, and one External Resource, not * already bound to this key, is selected. */ private void handleBind() { TreeItem xrItem = tree.getSelection()[0]; if (null != xrItem.getParentItem()) xrItem = xrItem.getParentItem(); ExternalResourceDescription xrd = getXRDescriptionFromTreeItem(xrItem); TableItem keyItem = resourceDependencySection.getTable().getSelection()[0]; ExternalResourceBinding xrb = new ExternalResourceBinding_impl(); String key = keyItem.getText(ResourceDependencySection.KEY_COL); xrb.setKey(key); xrb.setResourceName(xrd.getName()); getResourceManagerConfiguration().addExternalResourceBinding(xrb); addBindingToGUI(xrItem, key, xrb); xrItem.setExpanded(true); keyItem.setText(0, "Bound"); keyItem.getParent().getColumn(0).pack(); setFileDirty(); }