Package org.eclipse.wb.core.model

Examples of org.eclipse.wb.core.model.ObjectInfo


  //
  // Access
  //
  ////////////////////////////////////////////////////////////////////////////
  public int getActiveIndex() {
    ObjectInfo activeWidget = m_stackContainer.getActive();
    return activeWidget != null ? getContainer().getChildrenWidgets().indexOf(activeWidget) : 0;
  }
View Full Code Here


  /**
   * <code>TextItem</code> and <code>Separator</code> have no element initially, so we need this
   * workaround.
   */
  private void fetchElement() throws Exception {
    ObjectInfo parent = getParent();
    if (parent instanceof MenuInfo
        && ReflectionUtils.getFieldObject(getObject(), "element") == null) {
      MenuInfo parentMenu = (MenuInfo) parent;
      int index = parentMenu.getChildrenJava().indexOf(this);
      Object[] items =
View Full Code Here

  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected void refresh_fetch() throws Exception {
    super.refresh_fetch();
    ObjectInfo parent = getParent();
    if (parent instanceof CycleButtonInfo) {
      Rectangle parentBounds = ((CycleButtonInfo) parent).getModelBounds();
      setModelBounds(new Rectangle(0, parentBounds.height, parentBounds.width, 0));
    }
  }
View Full Code Here

    }, false);
  }

  public boolean validateMove(Object object) {
    if (isValidObjectType(object)) {
      ObjectInfo component = (ObjectInfo) object;
      // don't move item on its child menu
      return !component.isParentOf(m_menu);
    }
    return false;
  }
View Full Code Here

        }
      };

  private void openEditDialog(Property property) throws Exception {
    ObjectProperty objectProperty = (ObjectProperty) property;
    ObjectInfo objectInfo = objectProperty.getObjectInfo();
    IGwtStateProvider stateProvider = (IGwtStateProvider) objectInfo;
    // prepare not empty array of CSS files
    List<IFile> cssFiles = stateProvider.getState().getCssSupport().getFiles();
    if (cssFiles.isEmpty()) {
      MessageDialog.openError(
View Full Code Here

    return StringUtils.removeStart(selector, ".");
  }

  private void openNewDialog(Property property) throws Exception {
    ObjectProperty objectProperty = (ObjectProperty) property;
    ObjectInfo objectInfo = objectProperty.getObjectInfo();
    IGwtStateProvider stateProvider = (IGwtStateProvider) objectInfo;
    // prepare default name
    String initialName = "newStyleName";
    if (property.getValue() instanceof String) {
      initialName = (String) property.getValue();
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected void addItems(Property property, CComboBox combo) throws Exception {
    ObjectProperty objectProperty = (ObjectProperty) property;
    // prepare accessor
    ObjectInfo objectInfo = objectProperty.getObjectInfo();
    RuleAccessor accessor = RuleAccessor.get(objectInfo);
    // prepare style names
    List<String> styleNames = Lists.newArrayList();
    for (ContextDescription contextDescription : accessor.getContexts()) {
      for (CssRuleNode ruleNode : contextDescription.getRules()) {
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  public Property[] getProperties(Property property) throws Exception {
    final String styleName = getText(property);
    // prepare model
    ObjectProperty objectProperty = (ObjectProperty) property;
    ObjectInfo objectInfo = objectProperty.getObjectInfo();
    // use RuleAccessor
    final RuleAccessor accessor = RuleAccessor.get(objectInfo);
    if (accessor.hasSemantics(styleName)) {
      return new Property[]{
          new StyleColorValueProperty(accessor, styleName, "color", "color"),
View Full Code Here

   */
  private GwtState getGWTState(Property property) {
    if (m_state != null) {
      return m_state;
    } else {
      ObjectInfo model = property.getAdapter(ObjectInfo.class);
      return ((IGwtStateProvider) model).getState();
    }
  }
View Full Code Here

  /**
   * @return the {@link RuleAccessor} for this hierarchy.
   */
  public static RuleAccessor get(ObjectInfo object) {
    final ObjectInfo rootObject = object.getRoot();
    RuleAccessor accessor = m_instances.get(rootObject);
    if (accessor == null) {
      accessor = new RuleAccessor(rootObject);
      m_instances.put(rootObject, accessor);
      rootObject.addBroadcastListener(new ObjectEventListener() {
        @Override
        public void dispose() throws Exception {
          m_instances.remove(rootObject);
        }

View Full Code Here

TOP

Related Classes of org.eclipse.wb.core.model.ObjectInfo

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.