Package org.eclipse.wb.internal.core.xml.model

Examples of org.eclipse.wb.internal.core.xml.model.XmlObjectInfo


    }

    @Override
    protected void openDialog(Property property) throws Exception {
      NumberFormatProperty formatProperty = (NumberFormatProperty) property;
      XmlObjectInfo object = formatProperty.getObject();
      NumberFormatDialog dialog = new NumberFormatDialog(object);
      if (dialog.open() == Window.OK) {
        formatProperty.setValue(dialog.getResult());
      }
    }
View Full Code Here


    return ExecutionUtils.runObjectLog(new RunnableObjectEx<Boolean>() {
      public Boolean runObject() throws Exception {
        if (mementoObject instanceof List) {
          List<XmlObjectMemento> mementos = (List<XmlObjectMemento>) mementoObject;
          for (XmlObjectMemento memento : mementos) {
            XmlObjectInfo component = memento.create(m_menu);
            if (!isValidObjectType(component)) {
              return false;
            }
          }
          return true;
View Full Code Here

    ReflectionUtils.setField(binder, "dtObjectHandler", handler);
  }

  private void createModel(String path, Object object) throws Exception {
    DocumentElement xmlElement = m_pathToElementMap.get(path);
    XmlObjectInfo objectInfo =
        XmlObjectUtils.createObject(
            m_context,
            object.getClass(),
            new ElementCreationSupport(xmlElement));
    GlobalStateXml.activate(objectInfo);
    objectInfo.setObject(object);
    m_pathToModelMap.put(path, objectInfo);
  }
View Full Code Here

  }

  private void buildHierarchy() throws Exception {
    for (Map.Entry<String, XmlObjectInfo> entry : m_pathToModelMap.entrySet()) {
      String path = entry.getKey();
      XmlObjectInfo object = entry.getValue();
      if (object instanceof IsWidgetInfo) {
        object = ((IsWidgetInfo) object).getWrapped();
      }
      XmlObjectInfo parent = findParent(path);
      if (parent != null) {
        parent.addChild(object);
      } else {
        m_rootModel = object;
      }
    }
  }
View Full Code Here

   */
  private XmlObjectInfo findParent(String childPath) {
    String parentPath = StringUtils.substringBeforeLast(childPath, "/");
    for (Map.Entry<String, XmlObjectInfo> entry : m_pathToModelMap.entrySet()) {
      String path = entry.getKey();
      XmlObjectInfo parent = entry.getValue();
      if (path.equals(parentPath)) {
        return parent;
      }
    }
    if (childPath.contains("/")) {
View Full Code Here

   */
  private void assertNamespaceTag(String componentClassName,
      String expectedNamespace,
      String expectedTag,
      String[] expectedLines) throws Exception {
    XmlObjectInfo object = createObject(componentClassName);
    Class<?> componentClass = object.getDescription().getComponentClass();
    //
    String[] namespaceArray = new String[1];
    String[] tagArray = new String[1];
    object.getBroadcast(XmlObjectResolveTag.class).invoke(
        object,
        componentClass,
        namespaceArray,
        tagArray);
    String namespace = namespaceArray[0];
View Full Code Here

   */
  public static void decoratePresentationWithName(XmlObjectInfo root) {
    root.addBroadcastListener(new ObjectInfoPresentationDecorateText() {
      public void invoke(ObjectInfo object, String[] text) throws Exception {
        if (object instanceof XmlObjectInfo) {
          XmlObjectInfo xObject = (XmlObjectInfo) object;
          String name = getName(xObject);
          if (name != null) {
            text[0] = text[0] + " - " + name;
          }
        }
View Full Code Here

  public static void removeName_onDelete(XmlObjectInfo rootObject) {
    rootObject.addBroadcastListener(new ObjectInfoDelete() {
      @Override
      public void before(ObjectInfo parent, ObjectInfo child) throws Exception {
        if (child instanceof XmlObjectInfo) {
          XmlObjectInfo object = (XmlObjectInfo) child;
          removeName(object);
        }
      }
    });
  }
View Full Code Here

  /**
   * @return the {@link XmlObjectInfo} with the given name, may be <code>null</code>.
   */
  public static XmlObjectInfo getObject(XmlObjectInfo root, final String name) {
    final XmlObjectInfo result[] = {null};
    root.accept(new ObjectInfoVisitor() {
      @Override
      public void endVisit(ObjectInfo object) throws Exception {
        if (object instanceof XmlObjectInfo) {
          XmlObjectInfo xmlObject = (XmlObjectInfo) object;
          if (ObjectUtils.equals(getName(xmlObject), name)) {
            result[0] = xmlObject;
          }
        }
      }
View Full Code Here

    // add ui:field
    m_object.getRootXML().accept(new ObjectInfoVisitor() {
      @Override
      public void endVisit(ObjectInfo object) throws Exception {
        if (object instanceof XmlObjectInfo) {
          XmlObjectInfo xmlObject = (XmlObjectInfo) object;
          if (!XmlObjectUtils.isImplicit(xmlObject)) {
            String name = getName(xmlObject);
            if (name != null) {
              resultSet.add(name);
            }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.xml.model.XmlObjectInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.