/* (non-Javadoc)
  * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
  */
 public Object getPropertyValue(Object id) {
   if (m_inst.isOrphaned()) {
     return "";
   }
   if (id.equals("Descrip")) {
     return m_inst.getDescrip().replace('\n', '/');
   } else if (id.equals("GuardCondition")) {
     return m_inst.getGuardcondition();
   }
   return null;
 }
  /* (non-Javadoc)
   * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)
   */
  public void setPropertyValue(Object id, Object value) {
    boolean value_changed = false;
    String trans_name = "";
    Transaction tr = null;
    Ooaofooa modelRoot = (Ooaofooa) m_inst.getModelRoot();
    TransactionManager tm = TransactionManager.getSingleton();
    try {
      if (id.equals("Descrip")) {
        if (!value.toString().equals(m_inst.getDescrip())) {
          trans_name = "Change in property: 'Descrip' of Fork Join Node"; // $NON-NLS-1$
          tr = tm.startTransaction(trans_name, Ooaofooa.getDefaultInstance());
          value_changed = true;
          m_inst.setDescrip(value.toString());
        }
      } else if (id.equals("GuardCondition")) {
        if (!value.toString().equals(m_inst.getGuardcondition())) {
          trans_name = "Change in property: 'GuardCondition' of Fork Join Node"; // $NON-NLS-1$
          tr = tm.startTransaction(trans_name, Ooaofooa.getDefaultInstance());
          value_changed = true;
          m_inst.setGuardcondition(value.toString());
        }
      }

      // catch all exceptions and cancel the transaction
    } catch (Exception e) {
      // this can be null if there was
      // an exception starting the
      // transaction
      if (tr != null) {
        tm.cancelTransaction(tr, e);
        tr = null;
      }
      CorePlugin.logError("Transaction: " + trans_name + " could not complete", e);
    }
    if (tr != null) {
      if (value_changed) tm.endTransaction(tr);
      else tm.cancelTransaction(tr);
    }
  }
  /* (non-Javadoc)
   * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()
   */
  public IPropertyDescriptor[] getPropertyDescriptors() {
    if (m_inst == null || m_inst.isOrphaned()) return new IPropertyDescriptor[0];
    if (m_propertyDescriptors == null || 2 != m_propertyDescriptors.length) {
      m_propertyDescriptors = new PropertyDescriptor[2];
      boolean readonly = false;

      m_propertyDescriptors[0] =
          new DescriptionPropertyDescriptor("Descrip", "Fork Join Description", m_inst);
      m_propertyDescriptors[0].setCategory(BridgepointPropertySheetPage.basicCategoryName);
      m_propertyDescriptors[1] = new TextPropertyDescriptor("GuardCondition", "Guard Condition");
      m_propertyDescriptors[1].setCategory(BridgepointPropertySheetPage.basicCategoryName);
    }
    return m_propertyDescriptors;
  }
 public String toString() {
   return m_inst.Get_name();
 }