/** * Creates a new ButtonElementPropertySource. * * @param element the element whose properties this instance represents */ public AttributeDefPropertySource(Contained element) { super(element); abstObj = (AttributeDef) element; root = mf.getRootModule(abstObj); idlT.clear(); idlT.addAll(mf.getIDLTypes(abstObj)); idlTypeNames = mf.getIDLTTypedNames(idlT); idlTemp = CCMConstants.getIDLTemplate(abstObj.getIDLType(), idlT); }
/** @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object) */ public Object getPropertyValue(Object id) { switch (Integer.parseInt((String) id)) { case CCMModelPackage.ATTRIBUTE_DEF__IS_READONLY: if (abstObj.isIsReadonly()) return new Integer(1); else return new Integer(0); case CCMModelPackage.ATTRIBUTE_DEF__IDL_TYPE: return CCMConstants.getIDLName(idlTemp, mf.getIDLTTypedNames(idlT)); } return super.getPropertyValue(id); }
/** * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, * java.lang.Object) */ public void setPropertyValue(Object id, Object value) { switch (Integer.parseInt((String) id)) { case CCMModelPackage.ATTRIBUTE_DEF__IS_READONLY: int i = ((Integer) value).intValue(); if (i == 0) abstObj.setIsReadonly(false); else abstObj.setIsReadonly(true); break; case CCMModelPackage.ATTRIBUTE_DEF__IDL_TYPE: CCMConstants.setIDLTyped(abstObj, (IDLTemplate) value, root, idlT); idlTemp = (IDLTemplate) value; break; default: super.setPropertyValue(id, value); } }
/** @see org.eclipse.gef.commands.Command#execute() */ public void execute() { // super.execute(); newObject.setIdentifier(identifier); newObject.setVersion(version); /* modified by tri */ newObject.setAbsoluteName(container.getAbsoluteName() + ":" + identifier); /* if(container.getAbsoluteName().trim().length()!=0) newObject.setAbsoluteName(container.getAbsoluteName() + ":" + container.getIdentifier()); else newObject.setAbsoluteName(container.getIdentifier()); */ // TODO newObject.setRepositoryId( CCMConstants.getRepositoryIdString(newObject.getAbsoluteName(), identifier, version)); container.getContents().add(newObject); ((ProcessCollocation) container).getHomeInstances().add(newObject); List parentNodes = container.getNode(); for (Iterator it = parentNodes.iterator(); it.hasNext(); ) { Node parentNode = (Node) it.next(); node = factory.createNode(); newObject.getNode().add(node); node.setContained(newObject); view.getNode().add(node); node.setX(rectangle.x); node.setY(rectangle.y); node.setWidth(rectangle.width); node.setHeight(rectangle.height); parentNode.getContents().add(node); } ((HomeInstantiation) newObject).setCardinality(cardinality); ((HomeInstantiation) newObject).setRegName(regName); ((HomeInstantiation) newObject).setService(service); ((HomeInstantiation) newObject).setType(homeImpl); ((HomeInstantiation) newObject).setDeploymentUnit(impl); // ((InterfaceDef)newObject).setIsLocal(isLocal); node.eNotify( new CCMNotificationImpl( node, Notification.SET, CCMNotificationImpl.HOMEIINSTANCE, null, null, 0)); }
/** Auto-geenerated event handler method */ protected void identifierTxtKeyReleased(KeyEvent evt) { identifier = identifierTxt.getText(); repositoryId = CCMConstants.getRepositoryIdString(absName, identifier, version); repositoryIdTxt.setText(repositoryId); }
/** @param repositoryId The repositoryId to set. */ public void setRepositoryId(String absName, String id, String version) { this.absName = absName; this.repositoryId = CCMConstants.getRepositoryIdString(absName, id, version); }
/** @see org.eclipse.gef.commands.Command#execute() */ public void execute() { // setNewObject(factory.createImplementation()); // super.execute(); newObject.setIdentifier(identifier); newObject.setVersion(version); /* modified by tri */ newObject.setAbsoluteName(container.getAbsoluteName() + ":" + identifier); /* if(container.getAbsoluteName().trim().length()!=0) newObject.setAbsoluteName(container.getAbsoluteName() + ":" + container.getIdentifier()); else newObject.setAbsoluteName(container.getIdentifier()); */ // TODO newObject.setRepositoryId( CCMConstants.getRepositoryIdString(newObject.getAbsoluteName(), identifier, version)); container.getContents().add(newObject); ((SoftwarePackage) container).getImpl().add(newObject); // ((Implementation)newObject).setLicenseKey(licenseKey); // ((Implementation)newObject).setLicenseTexRef(licenseTextRef); ((Implementation) newObject).setUuid(uuid); ((Implementation) newObject).setComposition(composition); Iterator it = container.getNode().iterator(); while (it.hasNext()) { parentNode = (Node) it.next(); opNode = factory.createNode(); ((Implementation) newObject).getNode().add(opNode); opNode.setX(5); opNode.setY(8); opNode.setWidth(60); opNode.setHeight(40); parentNode.getContents().add(opNode); View view = parentNode.getView(); Unit_CompositionConnectCommand command = new Unit_CompositionConnectCommand(); List nodeList = view.getNode(); command.setSource(opNode); command.setView(view); for (Iterator nit = nodeList.iterator(); nit.hasNext(); ) { Node vn = (Node) nit.next(); if (composition.equals(vn.getContained())) { // command.setLabel(""); command.setTarget(vn); command.execute(); return; } } Node vn = factory.createNode(); vn.setContained(composition); vn.setX(parentNode.getX() + 180); vn.setY(parentNode.getY() + 160); vn.setWidth(100); vn.setHeight(60); vn.setView(view); composition.getNode().add(vn); view.getNode().add(vn); command.setTarget(vn); command.execute(); } }