/** * 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; }
/** * 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(); }