Program: 118955
Project: 118955
Buggy source:
/** 
 * yzhang MainComposite constructor comment.
 * @param parent
 * @param style
 */
public MainComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory factory,IRepositoryViewObject obj){
  super(parent,style,factory,obj);
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
  boolean allowVerchange=brandingService.getBrandingConfiguration().isAllowChengeVersion();
  allowEnableControl=false;
  enableControl=false;
  String framework=null;
  if (obj instanceof RepositoryViewObject || obj instanceof IProcess2) {
    if (obj instanceof RepositoryViewObject) {
      framework=((RepositoryViewObject)obj).getFramework();
    }
 else {
      framework=(String)((IProcess2)obj).getAdditionalProperties().get(ConvertJobsUtil.FRAMEWORK);
    }
    if (ERepositoryObjectType.getAllTypesOfProcess().contains(repositoryObject.getRepositoryObjectType())) {
      allowEnableControl=true;
      enableControl=true;
      if (!PluginChecker.isMapReducePluginLoader() && !PluginChecker.isStormPluginLoader()) {
        allowEnableControl=false;
      }
    }
  }
  FormLayout layout=new FormLayout();
  setLayout(layout);
  FormData thisFormData=new FormData();
  thisFormData.left=new FormAttachment(0,0);
  thisFormData.right=new FormAttachment(100,0);
  thisFormData.top=new FormAttachment(0,0);
  thisFormData.bottom=new FormAttachment(100,0);
  setLayoutData(thisFormData);
  Composite composite=widgetFactory.createFlatFormComposite(this);
  FormData compositeData=new FormData();
  compositeData.left=new FormAttachment(0,0);
  compositeData.right=new FormAttachment(100,0);
  compositeData.top=new FormAttachment(0,0);
  compositeData.bottom=new FormAttachment(100,0);
  composite.setLayoutData(thisFormData);
  nameText=widgetFactory.createText(composite,"String_Node_Str");
  FormData data=new FormData();
  data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
  data.right=new FormAttachment(50,0);
  data.top=new FormAttachment(0,ITabbedPropertyConstants.VSPACE);
  nameText.setLayoutData(data);
  String nameContent=repositoryObject.getLabel();
  nameText.setText(nameContent != null ? nameContent : "String_Node_Str");
  nameText.setEnabled(allowEnableControl);
  nameTextDecorator=new ControlDecoration(nameText,SWT.TOP | SWT.RIGHT);
  FieldDecoration fieldDecoration=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
  nameTextDecorator.setImage(fieldDecoration.getImage());
  nameTextDecorator.hide();
  CLabel nameLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(nameText,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(nameText,0,SWT.CENTER);
  nameLabel.setLayoutData(data);
  Text authorText=widgetFactory.createText(composite,"String_Node_Str");
  authorText.setEnabled(false);
  data=new FormData();
  data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
  data.right=new FormAttachment(50,0);
  data.top=new FormAttachment(nameLabel,ITabbedPropertyConstants.VSPACE);
  authorText.setLayoutData(data);
  User user=repositoryObject.getAuthor();
  if (user != null) {
    String author=user.getLogin();
    authorText.setText(author != null ? author : "String_Node_Str");
  }
 else {
    authorText.setText(nameContent);
  }
  authorText.setEnabled(false);
  CLabel authorLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(authorText,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(authorText,0,SWT.CENTER);
  authorLabel.setLayoutData(data);
  if (allowVerchange) {
    btnDown=widgetFactory.createButton(composite,"String_Node_Str",SWT.PUSH);
    data=new FormData();
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(authorText,0,SWT.CENTER);
    btnDown.setLayoutData(data);
    btnDown.setEnabled(allowEnableControl);
    btnUp=widgetFactory.createButton(composite,"String_Node_Str",SWT.PUSH);
    data=new FormData();
    data.right=new FormAttachment(btnDown,0);
    data.top=new FormAttachment(authorText,0,SWT.CENTER);
    btnUp.setLayoutData(data);
    btnUp.setEnabled(allowEnableControl);
    versionText=widgetFactory.createText(composite,"String_Node_Str");
    data=new FormData();
    data.left=new FormAttachment(authorText,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(btnUp,-2);
    data.top=new FormAttachment(authorText,0,SWT.CENTER);
    versionText.setLayoutData(data);
    String version=repositoryObject.getVersion();
    versionText.setText(version != null ? version : "String_Node_Str");
    versionText.setEnabled(allowEnableControl);
    CLabel versionLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(authorText,ITabbedPropertyConstants.HSPACE * 3);
    data.right=new FormAttachment(versionText,-ITabbedPropertyConstants.HSPACE);
    data.top=new FormAttachment(versionText,0,SWT.CENTER);
    versionLabel.setLayoutData(data);
  }
  if (allowEnableControl) {
    jobTypeCCombo=widgetFactory.createCCombo(composite,SWT.READ_ONLY | SWT.DROP_DOWN);
    data=new FormData();
    data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(50,0);
    data.top=new FormAttachment(authorLabel,ITabbedPropertyConstants.VSPACE);
    jobTypeCCombo.setLayoutData(data);
    jobTypeCCombo.setItems(JobType.getJobTypeToDispaly());
    String jobType=ConvertJobsUtil.getJobTypeFromFramework(framework);
    jobTypeCCombo.setText(jobType);
    jobTypeValue=jobTypeCCombo.getText();
    jobTypeCCombo.setEnabled(allowEnableControl);
    CLabel jobTypeLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(0,0);
    data.right=new FormAttachment(jobTypeCCombo,-ITabbedPropertyConstants.HSPACE);
    data.top=new FormAttachment(jobTypeCCombo,0,SWT.CENTER);
    jobTypeLabel.setLayoutData(data);
    jobFrameworkCCombo=widgetFactory.createCCombo(composite,SWT.READ_ONLY | SWT.DROP_DOWN);
    data=new FormData();
    data.left=new FormAttachment(jobTypeCCombo,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(authorLabel,ITabbedPropertyConstants.VSPACE);
    jobFrameworkCCombo.setLayoutData(data);
    jobFrameworkCCombo.setItems(ConvertJobsUtil.getFrameworkItemsByJobType(jobType));
    jobFrameworkCCombo.setText(framework != null ? framework : "String_Node_Str");
    frameworkValue=jobFrameworkCCombo.getText();
    jobFrameworkCCombo.setEnabled(allowEnableControl);
    CLabel jobFrameworkLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(jobTypeCCombo,ITabbedPropertyConstants.HSPACE - 10);
    data.right=new FormAttachment(jobFrameworkCCombo,ITabbedPropertyConstants.HSPACE + 1);
    data.top=new FormAttachment(jobFrameworkCCombo,0,SWT.CENTER);
    jobFrameworkLabel.setLayoutData(data);
    purposeText=widgetFactory.createText(composite,"String_Node_Str");
    data=new FormData();
    data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(50,0);
    data.top=new FormAttachment(jobTypeLabel,ITabbedPropertyConstants.VSPACE);
    purposeText.setLayoutData(data);
    String content=repositoryObject.getPurpose();
    purposeText.setText(content != null ? content : "String_Node_Str");
    purposeText.setEnabled(allowEnableControl);
    CLabel purposeLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(0,0);
    data.right=new FormAttachment(purposeText,-ITabbedPropertyConstants.HSPACE);
    data.top=new FormAttachment(purposeText,0,SWT.CENTER);
    purposeLabel.setLayoutData(data);
    statusText=widgetFactory.createCCombo(composite,SWT.READ_ONLY | SWT.BORDER);
    data=new FormData();
    data.left=new FormAttachment(purposeText,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(jobTypeLabel,ITabbedPropertyConstants.VSPACE);
    statusText.setLayoutData(data);
    String status=repositoryObject.getStatusCode();
    statusText.setText(status != null ? status : "String_Node_Str");
    statusText.setItems(Status.getStatusToDispaly());
    statusLabelText=getStatusMap().get(status);
    setStatusComboText(statusLabelText);
    statusText.setEnabled(allowEnableControl);
  }
 else {
    purposeText=widgetFactory.createText(composite,"String_Node_Str");
    data=new FormData();
    data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(50,0);
    data.top=new FormAttachment(authorLabel,ITabbedPropertyConstants.VSPACE);
    purposeText.setLayoutData(data);
    String content=repositoryObject.getPurpose();
    purposeText.setText(content != null ? content : "String_Node_Str");
    purposeText.setEnabled(enableControl);
    CLabel purposeLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(0,0);
    data.right=new FormAttachment(purposeText,-ITabbedPropertyConstants.HSPACE);
    data.top=new FormAttachment(purposeText,0,SWT.CENTER);
    purposeLabel.setLayoutData(data);
    statusText=widgetFactory.createCCombo(composite,SWT.READ_ONLY | SWT.BORDER);
    data=new FormData();
    data.left=new FormAttachment(purposeText,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(authorLabel,ITabbedPropertyConstants.VSPACE);
    statusText.setLayoutData(data);
    String status=repositoryObject.getStatusCode();
    statusText.setText(status != null ? status : "String_Node_Str");
    statusLabelText=getStatusMap().get(status);
    setStatusComboText(statusLabelText);
    statusText.setEnabled(enableControl);
  }
  CLabel statusLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(purposeText,ITabbedPropertyConstants.HSPACE * 3);
  data.right=new FormAttachment(statusText,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(statusText,0,SWT.CENTER);
  statusLabel.setLayoutData(data);
  statusText.setItems(Status.getStatusToDispaly());
  String status=repositoryObject.getStatusCode();
  statusLabelText=getStatusMap().get(status);
  setStatusComboText(statusLabelText);
  descriptionText=widgetFactory.createText(composite,"String_Node_Str",SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
  data=new FormData();
  data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
  data.right=new FormAttachment(100,0);
  data.top=new FormAttachment(statusText,ITabbedPropertyConstants.VSPACE);
  data.height=NB_LINES * descriptionText.getLineHeight();
  descriptionText.setLayoutData(data);
  String description=repositoryObject.getDescription();
  descriptionText.setText(description != null ? description : "String_Node_Str");
  descriptionText.setEnabled(true);
  descriptionText.setEditable(allowEnableControl);
  CLabel descriptionLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(descriptionText,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(descriptionText,0,SWT.TOP);
  descriptionLabel.setLayoutData(data);
  Text creationDate=widgetFactory.createText(composite,"String_Node_Str");
  data=new FormData();
  data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
  data.right=new FormAttachment(33,0);
  data.top=new FormAttachment(descriptionText,ITabbedPropertyConstants.VSPACE);
  creationDate.setLayoutData(data);
  creationDate.setEnabled(false);
  Date cDate=repositoryObject.getCreationDate();
  creationDate.setText(cDate != null ? FORMATTER.format(cDate) : "String_Node_Str");
  creationDate.setEnabled(enableControl);
  CLabel creationLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(creationDate,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(creationDate,0,SWT.CENTER);
  creationLabel.setLayoutData(data);
  Text modificationDate=widgetFactory.createText(composite,"String_Node_Str");
  data=new FormData();
  data.left=new FormAttachment(creationDate,AbstractPropertySection.STANDARD_LABEL_WIDTH + 25);
  data.right=new FormAttachment(66,0);
  data.top=new FormAttachment(descriptionText,ITabbedPropertyConstants.VSPACE);
  modificationDate.setLayoutData(data);
  modificationDate.setEnabled(false);
  Date mDate=repositoryObject.getModificationDate();
  modificationDate.setText(mDate != null ? FORMATTER.format(mDate) : "String_Node_Str");
  modificationDate.setEnabled(enableControl);
  CLabel modificationLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(creationDate,ITabbedPropertyConstants.HSPACE * 3);
  data.right=new FormAttachment(modificationDate,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(modificationDate,0,SWT.CENTER);
  modificationLabel.setLayoutData(data);
  if (allowEnableControl) {
    btnConfirm=widgetFactory.createButton(composite,"String_Node_Str",SWT.PUSH);
    data=new FormData();
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(modificationDate,0,SWT.CENTER);
    btnConfirm.setLayoutData(data);
    btnConfirm.setEnabled(false);
    nameText.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    jobTypeCCombo.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        ConvertJobsUtil.updateJobFrameworkPart(jobTypeCCombo.getText(),jobFrameworkCCombo);
        evaluateTextField();
      }
    }
);
    jobFrameworkCCombo.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    purposeText.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    statusText.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    descriptionText.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    if (allowVerchange) {
      btnUp.addSelectionListener(new SelectionAdapter(){
        @Override public void widgetSelected(        SelectionEvent e){
          String version=repositoryObject.getVersion();
          if (lastVersionFound != null && VersionUtils.compareTo(lastVersionFound,version) > 0) {
            version=lastVersionFound;
          }
          version=VersionUtils.upMajor(version);
          versionText.setText(version);
          lastVersionFound=version;
          evaluateTextField();
        }
      }
);
      btnDown.addSelectionListener(new SelectionAdapter(){
        @Override public void widgetSelected(        SelectionEvent e){
          String version=repositoryObject.getVersion();
          if (lastVersionFound != null && VersionUtils.compareTo(lastVersionFound,version) > 0) {
            version=lastVersionFound;
          }
          version=VersionUtils.upMinor(version);
          versionText.setText(version);
          lastVersionFound=version;
          evaluateTextField();
        }
      }
);
      btnConfirm.addSelectionListener(new SelectionAdapter(){
        @Override public void widgetSelected(        SelectionEvent e){
          final IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
          Property property=repositoryObject.getProperty();
          if (nameText == null || nameText.isDisposed() || versionText == null || versionText.isDisposed() || purposeText == null || purposeText.isDisposed() || jobTypeCCombo == null || jobTypeCCombo.isDisposed() || jobFrameworkCCombo == null || jobFrameworkCCombo.isDisposed() || statusText == null || statusText.isDisposed() || descriptionText == null || descriptionText.isDisposed() || btnConfirm == null || btnConfirm.isDisposed() || property == null) {
            return;
          }
          String originalName=nameText.getText();
          String originalJobType=jobTypeCCombo.getText();
          String originalFramework=jobFrameworkCCombo.getText();
          String originalversion=versionText.getText();
          String originalPurpose=purposeText.getText();
          String originalStatus=statusText.getText();
          String originalDescription=descriptionText.getText();
          if (repositoryObject instanceof IProcess2) {
            IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
              @Override public void run(              final IProgressMonitor monitor) throws CoreException {
                DeleteActionCache.getInstance().closeOpenedEditor(repositoryObject);
              }
            }
;
            IWorkspace workspace=ResourcesPlugin.getWorkspace();
            try {
              ISchedulingRule schedulingRule=workspace.getRoot();
              workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
            }
 catch (            CoreException e1) {
              MessageBoxExceptionHandler.process(e1.getCause());
            }
          }
          String newJobName=null;
          if (!originalName.equals(StringUtils.trimToEmpty(repositoryObject.getLabel()))) {
            newJobName=originalName;
          }
          if (!originalversion.equals(StringUtils.trimToEmpty(repositoryObject.getVersion()))) {
            property.setVersion(originalversion);
          }
          if (!originalPurpose.equals(StringUtils.trimToEmpty(repositoryObject.getPurpose()))) {
            property.setPurpose(originalPurpose);
          }
          if (!originalStatus.equals(StringUtils.trimToEmpty(repositoryObject.getStatusCode()))) {
            property.setStatusCode(getStatusCode(getStatusMap(),originalStatus));
          }
          if (!originalDescription.equals(StringUtils.trimToEmpty(repositoryObject.getDescription()))) {
            property.setDescription(originalDescription);
          }
          boolean convert=true;
          if (originalJobType.equals(StringUtils.trimToEmpty(jobTypeValue))) {
            convert=false;
          }
          if (convert) {
            final Item newItem=ConvertJobsUtil.createOperation(originalName,originalJobType,originalFramework,repositoryObject);
            IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
              @Override public void run(              final IProgressMonitor monitor) throws CoreException {
                try {
                  boolean isOpened=false;
                  if (repositoryObject instanceof IProcess2) {
                    isOpened=true;
                    boolean locked=proxyRepositoryFactory.getStatus(repositoryObject) == ERepositoryStatus.LOCK_BY_USER;
                    if (locked) {
                      proxyRepositoryFactory.unlock(repositoryObject);
                    }
                  }
                  proxyRepositoryFactory.deleteObjectPhysical(repositoryObject);
                  proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
                  if (newItem != null && newItem.getProperty() != null) {
                    String newId=newItem.getProperty().getId();
                    newRepositoryObject=proxyRepositoryFactory.getLastVersion(ProjectManager.getInstance().getCurrentProject(),newId);
                    if (!isOpened) {
                      repositoryObject=newRepositoryObject;
                      if (!jobTypeCCombo.isDisposed() && !jobFrameworkCCombo.isDisposed()) {
                        jobTypeValue=jobTypeCCombo.getText();
                        frameworkValue=jobFrameworkCCombo.getText();
                      }
                    }
                  }
                }
 catch (                PersistenceException e1) {
                  e1.printStackTrace();
                }
catch (                LoginException e) {
                  e.printStackTrace();
                }
              }
            }
;
            IWorkspace workspace=ResourcesPlugin.getWorkspace();
            try {
              ISchedulingRule schedulingRule=workspace.getRoot();
              workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
            }
 catch (            CoreException e1) {
              MessageBoxExceptionHandler.process(e1.getCause());
            }
            if (newItem != null && repositoryObject instanceof IProcess2) {
              if (newRepositoryObject != null && newRepositoryObject.getProperty() != null) {
                openEditorOperation(newRepositoryObject.getProperty().getItem());
              }
            }
          }
 else {
            if (newJobName != null) {
              property.setLabel(newJobName);
              property.setDisplayName(newJobName);
            }
            if (originalFramework != null) {
              if (property.getAdditionalProperties().containsKey(ConvertJobsUtil.FRAMEWORK)) {
                property.getAdditionalProperties().removeKey(ConvertJobsUtil.FRAMEWORK);
              }
              property.getAdditionalProperties().put(ConvertJobsUtil.FRAMEWORK,originalFramework);
            }
            IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
              @Override public void run(              final IProgressMonitor monitor) throws CoreException {
                try {
                  if (repositoryObject.getProperty() != null) {
                    proxyRepositoryFactory.save(ProjectManager.getInstance().getCurrentProject(),repositoryObject.getProperty().getItem(),false);
                  }
                }
 catch (                PersistenceException e1) {
                  e1.printStackTrace();
                }
              }
            }
;
            IWorkspace workspace=ResourcesPlugin.getWorkspace();
            try {
              ISchedulingRule schedulingRule=workspace.getRoot();
              workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
            }
 catch (            CoreException e1) {
              MessageBoxExceptionHandler.process(e1.getCause());
            }
            if (repositoryObject instanceof IProcess2) {
              openEditorOperation(property.getItem());
            }
          }
          if (!btnConfirm.isDisposed()) {
            btnConfirm.setEnabled(false);
          }
        }
      }
);
    }
  }
}

Fixed version (ground truth):
/** 
 * yzhang MainComposite constructor comment.
 * @param parent
 * @param style
 */
public MainComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory factory,IRepositoryViewObject obj){
  super(parent,style,factory,obj);
  IBrandingService brandingService=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
  boolean allowVerchange=brandingService.getBrandingConfiguration().isAllowChengeVersion();
  allowEnableControl=false;
  enableControl=false;
  String framework=null;
  if (obj instanceof RepositoryViewObject || obj instanceof IProcess2) {
    if (obj instanceof RepositoryViewObject) {
      framework=((RepositoryViewObject)obj).getFramework();
    }
 else {
      framework=(String)((IProcess2)obj).getAdditionalProperties().get(ConvertJobsUtil.FRAMEWORK);
    }
    if (ERepositoryObjectType.getAllTypesOfProcess().contains(repositoryObject.getRepositoryObjectType())) {
      allowEnableControl=true;
      enableControl=true;
      if (!PluginChecker.isMapReducePluginLoader() && !PluginChecker.isStormPluginLoader()) {
        allowEnableControl=false;
      }
    }
  }
  FormLayout layout=new FormLayout();
  setLayout(layout);
  FormData thisFormData=new FormData();
  thisFormData.left=new FormAttachment(0,0);
  thisFormData.right=new FormAttachment(100,0);
  thisFormData.top=new FormAttachment(0,0);
  thisFormData.bottom=new FormAttachment(100,0);
  setLayoutData(thisFormData);
  Composite composite=widgetFactory.createFlatFormComposite(this);
  FormData compositeData=new FormData();
  compositeData.left=new FormAttachment(0,0);
  compositeData.right=new FormAttachment(100,0);
  compositeData.top=new FormAttachment(0,0);
  compositeData.bottom=new FormAttachment(100,0);
  composite.setLayoutData(thisFormData);
  nameText=widgetFactory.createText(composite,"String_Node_Str");
  FormData data=new FormData();
  data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
  data.right=new FormAttachment(50,0);
  data.top=new FormAttachment(0,ITabbedPropertyConstants.VSPACE);
  nameText.setLayoutData(data);
  String nameContent=repositoryObject.getLabel();
  nameText.setText(nameContent != null ? nameContent : "String_Node_Str");
  nameText.setEnabled(allowEnableControl);
  nameTextDecorator=new ControlDecoration(nameText,SWT.TOP | SWT.RIGHT);
  FieldDecoration fieldDecoration=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
  nameTextDecorator.setImage(fieldDecoration.getImage());
  nameTextDecorator.hide();
  CLabel nameLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(nameText,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(nameText,0,SWT.CENTER);
  nameLabel.setLayoutData(data);
  Text authorText=widgetFactory.createText(composite,"String_Node_Str");
  authorText.setEnabled(false);
  data=new FormData();
  data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
  data.right=new FormAttachment(50,0);
  data.top=new FormAttachment(nameLabel,ITabbedPropertyConstants.VSPACE);
  authorText.setLayoutData(data);
  User user=repositoryObject.getAuthor();
  if (user != null) {
    String author=user.getLogin();
    authorText.setText(author != null ? author : "String_Node_Str");
  }
 else {
    authorText.setText(nameContent);
  }
  authorText.setEnabled(false);
  CLabel authorLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(authorText,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(authorText,0,SWT.CENTER);
  authorLabel.setLayoutData(data);
  if (allowVerchange) {
    btnDown=widgetFactory.createButton(composite,"String_Node_Str",SWT.PUSH);
    data=new FormData();
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(authorText,0,SWT.CENTER);
    btnDown.setLayoutData(data);
    btnDown.setEnabled(allowEnableControl);
    btnUp=widgetFactory.createButton(composite,"String_Node_Str",SWT.PUSH);
    data=new FormData();
    data.right=new FormAttachment(btnDown,0);
    data.top=new FormAttachment(authorText,0,SWT.CENTER);
    btnUp.setLayoutData(data);
    btnUp.setEnabled(allowEnableControl);
    versionText=widgetFactory.createText(composite,"String_Node_Str");
    data=new FormData();
    data.left=new FormAttachment(authorText,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(btnUp,-2);
    data.top=new FormAttachment(authorText,0,SWT.CENTER);
    versionText.setLayoutData(data);
    String version=repositoryObject.getVersion();
    versionText.setText(version != null ? version : "String_Node_Str");
    versionText.setEnabled(allowEnableControl);
    CLabel versionLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(authorText,ITabbedPropertyConstants.HSPACE * 3);
    data.right=new FormAttachment(versionText,-ITabbedPropertyConstants.HSPACE);
    data.top=new FormAttachment(versionText,0,SWT.CENTER);
    versionLabel.setLayoutData(data);
  }
  if (allowEnableControl) {
    jobTypeCCombo=widgetFactory.createCCombo(composite,SWT.READ_ONLY | SWT.DROP_DOWN);
    data=new FormData();
    data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(50,0);
    data.top=new FormAttachment(authorLabel,ITabbedPropertyConstants.VSPACE);
    jobTypeCCombo.setLayoutData(data);
    jobTypeCCombo.setItems(JobType.getJobTypeToDispaly());
    String jobType=ConvertJobsUtil.getJobTypeFromFramework(framework);
    jobTypeCCombo.setText(jobType);
    jobTypeValue=jobTypeCCombo.getText();
    jobTypeCCombo.setEnabled(allowEnableControl);
    CLabel jobTypeLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(0,0);
    data.right=new FormAttachment(jobTypeCCombo,-ITabbedPropertyConstants.HSPACE);
    data.top=new FormAttachment(jobTypeCCombo,0,SWT.CENTER);
    jobTypeLabel.setLayoutData(data);
    jobFrameworkCCombo=widgetFactory.createCCombo(composite,SWT.READ_ONLY | SWT.DROP_DOWN);
    data=new FormData();
    data.left=new FormAttachment(jobTypeCCombo,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(authorLabel,ITabbedPropertyConstants.VSPACE);
    jobFrameworkCCombo.setLayoutData(data);
    jobFrameworkCCombo.setItems(ConvertJobsUtil.getFrameworkItemsByJobType(jobType));
    jobFrameworkCCombo.setText(framework != null ? framework : "String_Node_Str");
    frameworkValue=jobFrameworkCCombo.getText();
    jobFrameworkCCombo.setEnabled(allowEnableControl);
    CLabel jobFrameworkLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(jobTypeCCombo,ITabbedPropertyConstants.HSPACE - 10);
    data.right=new FormAttachment(jobFrameworkCCombo,ITabbedPropertyConstants.HSPACE + 1);
    data.top=new FormAttachment(jobFrameworkCCombo,0,SWT.CENTER);
    jobFrameworkLabel.setLayoutData(data);
    purposeText=widgetFactory.createText(composite,"String_Node_Str");
    data=new FormData();
    data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(50,0);
    data.top=new FormAttachment(jobTypeLabel,ITabbedPropertyConstants.VSPACE);
    purposeText.setLayoutData(data);
    String content=repositoryObject.getPurpose();
    purposeText.setText(content != null ? content : "String_Node_Str");
    purposeText.setEnabled(allowEnableControl);
    CLabel purposeLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(0,0);
    data.right=new FormAttachment(purposeText,-ITabbedPropertyConstants.HSPACE);
    data.top=new FormAttachment(purposeText,0,SWT.CENTER);
    purposeLabel.setLayoutData(data);
    statusText=widgetFactory.createCCombo(composite,SWT.READ_ONLY | SWT.BORDER);
    data=new FormData();
    data.left=new FormAttachment(purposeText,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(jobTypeLabel,ITabbedPropertyConstants.VSPACE);
    statusText.setLayoutData(data);
    String status=repositoryObject.getStatusCode();
    statusText.setText(status != null ? status : "String_Node_Str");
    statusText.setItems(Status.getStatusToDispaly());
    statusLabelText=getStatusMap().get(status);
    setStatusComboText(statusLabelText);
    statusText.setEnabled(allowEnableControl);
  }
 else {
    purposeText=widgetFactory.createText(composite,"String_Node_Str");
    data=new FormData();
    data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(50,0);
    data.top=new FormAttachment(authorLabel,ITabbedPropertyConstants.VSPACE);
    purposeText.setLayoutData(data);
    String content=repositoryObject.getPurpose();
    purposeText.setText(content != null ? content : "String_Node_Str");
    purposeText.setEnabled(enableControl);
    CLabel purposeLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
    data=new FormData();
    data.left=new FormAttachment(0,0);
    data.right=new FormAttachment(purposeText,-ITabbedPropertyConstants.HSPACE);
    data.top=new FormAttachment(purposeText,0,SWT.CENTER);
    purposeLabel.setLayoutData(data);
    statusText=widgetFactory.createCCombo(composite,SWT.READ_ONLY | SWT.BORDER);
    data=new FormData();
    data.left=new FormAttachment(purposeText,AbstractPropertySection.STANDARD_LABEL_WIDTH);
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(authorLabel,ITabbedPropertyConstants.VSPACE);
    statusText.setLayoutData(data);
    String status=repositoryObject.getStatusCode();
    statusText.setText(status != null ? status : "String_Node_Str");
    statusLabelText=getStatusMap().get(status);
    setStatusComboText(statusLabelText);
    statusText.setEnabled(enableControl);
  }
  CLabel statusLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(purposeText,ITabbedPropertyConstants.HSPACE * 3);
  data.right=new FormAttachment(statusText,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(statusText,0,SWT.CENTER);
  statusLabel.setLayoutData(data);
  statusText.setItems(Status.getStatusToDispaly());
  String status=repositoryObject.getStatusCode();
  statusLabelText=getStatusMap().get(status);
  setStatusComboText(statusLabelText);
  descriptionText=widgetFactory.createText(composite,"String_Node_Str",SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
  data=new FormData();
  data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
  data.right=new FormAttachment(100,0);
  data.top=new FormAttachment(statusText,ITabbedPropertyConstants.VSPACE);
  data.height=NB_LINES * descriptionText.getLineHeight();
  descriptionText.setLayoutData(data);
  String description=repositoryObject.getDescription();
  descriptionText.setText(description != null ? description : "String_Node_Str");
  descriptionText.setEnabled(true);
  descriptionText.setEditable(allowEnableControl);
  CLabel descriptionLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(descriptionText,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(descriptionText,0,SWT.TOP);
  descriptionLabel.setLayoutData(data);
  Text creationDate=widgetFactory.createText(composite,"String_Node_Str");
  data=new FormData();
  data.left=new FormAttachment(0,AbstractPropertySection.STANDARD_LABEL_WIDTH);
  data.right=new FormAttachment(33,0);
  data.top=new FormAttachment(descriptionText,ITabbedPropertyConstants.VSPACE);
  creationDate.setLayoutData(data);
  creationDate.setEnabled(false);
  Date cDate=repositoryObject.getCreationDate();
  creationDate.setText(cDate != null ? FORMATTER.format(cDate) : "String_Node_Str");
  creationDate.setEnabled(enableControl);
  CLabel creationLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(0,0);
  data.right=new FormAttachment(creationDate,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(creationDate,0,SWT.CENTER);
  creationLabel.setLayoutData(data);
  Text modificationDate=widgetFactory.createText(composite,"String_Node_Str");
  data=new FormData();
  data.left=new FormAttachment(creationDate,AbstractPropertySection.STANDARD_LABEL_WIDTH + 25);
  data.right=new FormAttachment(66,0);
  data.top=new FormAttachment(descriptionText,ITabbedPropertyConstants.VSPACE);
  modificationDate.setLayoutData(data);
  modificationDate.setEnabled(false);
  Date mDate=repositoryObject.getModificationDate();
  modificationDate.setText(mDate != null ? FORMATTER.format(mDate) : "String_Node_Str");
  modificationDate.setEnabled(enableControl);
  CLabel modificationLabel=widgetFactory.createCLabel(composite,Messages.getString("String_Node_Str"));
  data=new FormData();
  data.left=new FormAttachment(creationDate,ITabbedPropertyConstants.HSPACE * 3);
  data.right=new FormAttachment(modificationDate,-ITabbedPropertyConstants.HSPACE);
  data.top=new FormAttachment(modificationDate,0,SWT.CENTER);
  modificationLabel.setLayoutData(data);
  if (allowEnableControl) {
    btnConfirm=widgetFactory.createButton(composite,"String_Node_Str",SWT.PUSH);
    data=new FormData();
    data.right=new FormAttachment(100,0);
    data.top=new FormAttachment(modificationDate,0,SWT.CENTER);
    btnConfirm.setLayoutData(data);
    btnConfirm.setEnabled(false);
    nameText.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    jobTypeCCombo.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        ConvertJobsUtil.updateJobFrameworkPart(jobTypeCCombo.getText(),jobFrameworkCCombo);
        evaluateTextField();
      }
    }
);
    jobFrameworkCCombo.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    purposeText.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    statusText.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    descriptionText.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        evaluateTextField();
      }
    }
);
    if (allowVerchange) {
      btnUp.addSelectionListener(new SelectionAdapter(){
        @Override public void widgetSelected(        SelectionEvent e){
          String version=repositoryObject.getVersion();
          if (lastVersionFound != null && VersionUtils.compareTo(lastVersionFound,version) > 0) {
            version=lastVersionFound;
          }
          version=VersionUtils.upMajor(version);
          versionText.setText(version);
          lastVersionFound=version;
          evaluateTextField();
        }
      }
);
      btnDown.addSelectionListener(new SelectionAdapter(){
        @Override public void widgetSelected(        SelectionEvent e){
          String version=repositoryObject.getVersion();
          if (lastVersionFound != null && VersionUtils.compareTo(lastVersionFound,version) > 0) {
            version=lastVersionFound;
          }
          version=VersionUtils.upMinor(version);
          versionText.setText(version);
          lastVersionFound=version;
          evaluateTextField();
        }
      }
);
      btnConfirm.addSelectionListener(new SelectionAdapter(){
        @Override public void widgetSelected(        SelectionEvent e){
          final IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
          Property property=repositoryObject.getProperty();
          if (nameText == null || nameText.isDisposed() || versionText == null || versionText.isDisposed() || purposeText == null || purposeText.isDisposed() || jobTypeCCombo == null || jobTypeCCombo.isDisposed() || jobFrameworkCCombo == null || jobFrameworkCCombo.isDisposed() || statusText == null || statusText.isDisposed() || descriptionText == null || descriptionText.isDisposed() || btnConfirm == null || btnConfirm.isDisposed() || property == null) {
            return;
          }
          String originalName=nameText.getText();
          String originalJobType=jobTypeCCombo.getText();
          String originalFramework=jobFrameworkCCombo.getText();
          String originalversion=versionText.getText();
          String originalPurpose=purposeText.getText();
          String originalStatus=statusText.getText();
          String originalDescription=descriptionText.getText();
          if (repositoryObject instanceof IProcess2) {
            IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
              @Override public void run(              final IProgressMonitor monitor) throws CoreException {
                DeleteActionCache.getInstance().closeOpenedEditor(repositoryObject);
              }
            }
;
            IWorkspace workspace=ResourcesPlugin.getWorkspace();
            try {
              ISchedulingRule schedulingRule=workspace.getRoot();
              workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
            }
 catch (            CoreException e1) {
              MessageBoxExceptionHandler.process(e1.getCause());
            }
          }
          String newJobName=null;
          if (!originalName.equals(StringUtils.trimToEmpty(repositoryObject.getLabel()))) {
            newJobName=originalName;
          }
          if (!originalversion.equals(StringUtils.trimToEmpty(repositoryObject.getVersion()))) {
            property.setVersion(originalversion);
          }
          if (!originalPurpose.equals(StringUtils.trimToEmpty(repositoryObject.getPurpose()))) {
            property.setPurpose(originalPurpose);
          }
          if (!originalStatus.equals(StringUtils.trimToEmpty(repositoryObject.getStatusCode()))) {
            property.setStatusCode(getStatusCode(getStatusMap(),originalStatus));
          }
          if (!originalDescription.equals(StringUtils.trimToEmpty(repositoryObject.getDescription()))) {
            property.setDescription(originalDescription);
          }
          boolean convert=true;
          if (originalJobType.equals(StringUtils.trimToEmpty(jobTypeValue))) {
            convert=false;
          }
          if (convert) {
            final Item newItem=ConvertJobsUtil.createOperation(originalName,originalJobType,originalFramework,repositoryObject);
            IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
              @Override public void run(              final IProgressMonitor monitor) throws CoreException {
                try {
                  boolean isOpened=false;
                  if (repositoryObject instanceof IProcess2) {
                    isOpened=true;
                    boolean locked=proxyRepositoryFactory.getStatus(repositoryObject) == ERepositoryStatus.LOCK_BY_USER;
                    if (locked) {
                      proxyRepositoryFactory.unlock(repositoryObject);
                    }
                  }
                  proxyRepositoryFactory.deleteObjectPhysical(repositoryObject);
                  proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
                  if (newItem != null && newItem.getProperty() != null) {
                    String newId=newItem.getProperty().getId();
                    newRepositoryObject=proxyRepositoryFactory.getLastVersion(ProjectManager.getInstance().getCurrentProject(),newId);
                    if (!isOpened) {
                      repositoryObject=newRepositoryObject;
                      if (!jobTypeCCombo.isDisposed() && !jobFrameworkCCombo.isDisposed()) {
                        jobTypeValue=jobTypeCCombo.getText();
                        frameworkValue=jobFrameworkCCombo.getText();
                      }
                    }
                  }
                }
 catch (                PersistenceException e1) {
                  e1.printStackTrace();
                }
catch (                LoginException e) {
                  e.printStackTrace();
                }
              }
            }
;
            IWorkspace workspace=ResourcesPlugin.getWorkspace();
            try {
              ISchedulingRule schedulingRule=workspace.getRoot();
              workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
            }
 catch (            CoreException e1) {
              MessageBoxExceptionHandler.process(e1.getCause());
            }
            if (newItem != null && repositoryObject instanceof IProcess2) {
              if (newRepositoryObject != null && newRepositoryObject.getProperty() != null) {
                openEditorOperation(newRepositoryObject.getProperty().getItem());
              }
            }
          }
 else {
            if (newJobName != null) {
              property.setLabel(newJobName);
              property.setDisplayName(newJobName);
            }
            if (originalFramework != null) {
              if (property.getAdditionalProperties().containsKey(ConvertJobsUtil.FRAMEWORK)) {
                property.getAdditionalProperties().removeKey(ConvertJobsUtil.FRAMEWORK);
              }
              property.getAdditionalProperties().put(ConvertJobsUtil.FRAMEWORK,originalFramework);
            }
            IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
              @Override public void run(              final IProgressMonitor monitor) throws CoreException {
                try {
                  if (repositoryObject.getProperty() != null) {
                    proxyRepositoryFactory.save(ProjectManager.getInstance().getCurrentProject(),repositoryObject.getProperty().getItem(),false);
                  }
                }
 catch (                PersistenceException e1) {
                  e1.printStackTrace();
                }
              }
            }
;
            IWorkspace workspace=ResourcesPlugin.getWorkspace();
            try {
              ISchedulingRule schedulingRule=workspace.getRoot();
              workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
            }
 catch (            CoreException e1) {
              MessageBoxExceptionHandler.process(e1.getCause());
            }
            if (repositoryObject instanceof IProcess2) {
              openEditorOperation(property.getItem());
            }
          }
          IViewPart jobSettingView=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
          if (jobSettingView != null && jobSettingView instanceof IJobSettingsView) {
            Map<String,Object> propertiesMap=new HashMap<String,Object>();
            propertiesMap.put(IJobSettingsView.JOBTYPE_CHANGED,repositoryObject);
            ((IJobSettingsView)jobSettingView).onPropertiesChanged(propertiesMap);
          }
          if (!btnConfirm.isDisposed()) {
            btnConfirm.setEnabled(false);
          }
        }
      }
);
    }
  }
}