xmls.getTransformer().transform(new DOMSource(named.getElement()), new StreamResult(writer));
xmls.getTransformer().transform(new DOMSource(named.getElement()), new StreamResult(writer));
public void doWidgetSelected(SelectionEvent e) { if (e.widget == refCombo) { String newValue = refCombo.getText(); if (input instanceof XSDNamedComponent) { XSDNamedComponent namedComponent = (XSDNamedComponent)input; Element element = namedComponent.getElement(); if (namedComponent instanceof XSDAttributeGroupDefinition) { element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue); } } } super.doWidgetSelected(e); }
public void doWidgetSelected(SelectionEvent e) { if (e.widget == componentNameCombo) { String newValue = componentNameCombo.getText(); if (input instanceof XSDNamedComponent) { XSDNamedComponent namedComponent = (XSDNamedComponent)input; Element element = namedComponent.getElement(); if (namedComponent instanceof XSDModelGroupDefinition) { element.setAttribute(XSDConstants.REF_ATTRIBUTE, newValue); } } } super.doWidgetSelected(e); }
public void execute() { try { beginRecording(component.getElement()); renameComponent(newName); } finally { endRecording(); } }
Element element = namedComponent.getElement(); if (element != null)
Element element = namedComponent.getElement(); if (element != null)
/** * Performs a rename refactoring to rename the component and all the * references to it within the current schema. * * @param newName the new component name. */ private void renameComponent(String newName) { // this is a 'globally' defined component (e.g. global element) if (component.eContainer() instanceof XSDSchema) { RefactoringComponent refactoringComponent = new XMLRefactoringComponent( component, (IDOMElement)component.getElement(), component.getName(), component.getTargetNamespace()); RenameComponentProcessor processor = new RenameComponentProcessor(refactoringComponent, newName, true); RenameRefactoring refactoring = new RenameRefactoring(processor); PerformUnsavedRefactoringOperation operation = new PerformUnsavedRefactoringOperation(refactoring); operation.run(null); } else { // this is a 'locally' defined component (e.g. local element) // no need to call refactoring since this component can't be referenced component.setName(newName); } } }
(IDOMElement)selectedComponent.getElement(), selectedComponent.getName(), selectedComponent.getTargetNamespace());