Package org.objectstyle.wolips.wodclipse.core.refactoring

Examples of org.objectstyle.wolips.wodclipse.core.refactoring.AddKeyInfo


      if (componentEditorPart != null) {
        TemplateEditor templateEditor = getTemplateEditor();
        WodEditor wodEditor = getWodEditor();
        if (templateEditor != null && wodEditor != null) {
          IType componentType = templateEditor.getParserCache().getComponentType();
          AddKeyInfo info = new AddKeyInfo(componentType);
          AddKeyDialog.open(info, getComponentEditorPart().getSite().getShell());
        }
      }
    } catch (Exception e) {
      ErrorUtils.openErrorDialog(getComponentEditorPart().getSite().getShell(), e);
View Full Code Here


      info.setName(bindingValueKeyPath.getOriginalKeyPath());
      AddActionDialog.open(info, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
      name = info.getName();
    }
    else {
      AddKeyInfo info = new AddKeyInfo(componentType);
      info.setName(bindingValueKeyPath.getOriginalKeyPath());
      AddKeyDialog.open(info, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
      name = info.getName();
    }
    return name;
  }
View Full Code Here

        if (componentType != null) {
          for (DisplayGroup displayGroup : getDisplayGroups()) {
            String originalName = displayGroup.getOriginalName();
            String newName = displayGroup.getName();
            String newClassName = displayGroup.getClassName();
            AddKeyInfo info = new AddKeyInfo(componentType);
            info.setTypeName(displayGroup.getClassName());
            info.setName(newName);
            info.setCreateAccessorMethod(false);
            info.setCreateMutatorMethod(false);
           
            // Populate generic types if required
            IType classType = findDisplayGroupClass(displayGroup.getClassName());
            String newParameterType = "";
            if (classType !=null && classType.getTypeParameters().length > 0) {
              newParameterType = displayGroup.getEntityName();
              info.setParameterTypeName(newParameterType);
            }
           
            IField field = componentType.getField(info.getFieldName());
            if (originalName == null) {
              if (!field.exists()) {
                AddKeyOperation.addKey(info);
              }
            } else {
              info.setName(originalName);
              field = componentType.getField(info.getFieldName());
              if (field.exists()) {
                String originalClassName = Signature.getSignatureSimpleName(Signature.getTypeErasure(field.getTypeSignature()));
                String types[] = Signature.getTypeArguments(field.getTypeSignature());
                String originalParameterType = types.length > 0 ? Signature.getSignatureSimpleName(types[0]) : "";

                if (!originalName.equals(newName) || !originalClassName.equals(displayGroup.getClassName())
                    || !originalParameterType.equals(newParameterType)) {
                  info.setName(newName);
                  AddKeyOperation.replaceField(info, originalName);
                }}
            }
          }
         
          if (_removedDisplayGroups != null) {
            for (DisplayGroup displayGroup : _removedDisplayGroups) {
              String originalName = displayGroup.getOriginalName();
              if (originalName != null) {
                AddKeyInfo info = new AddKeyInfo(componentType);
                info.setName(originalName);
                IField field = componentType.getField(info.getFieldName());
                if (field.exists()) {
                  field.delete(false, null);
                }
              }
            }
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.wodclipse.core.refactoring.AddKeyInfo

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.