コード例 #1
0
  private void SQ_S_NewInstance(IStructuredSelection selection) {
    // Assign the context selection variables with the action context
    // Assign the context selection variable with the action context
    Object context = selection.iterator().next();
    Sequence_c v_sequence = (Sequence_c) context;
    PersistableModelComponent.ensureCoreDataTypesAvailable(v_sequence.getModelRoot());

    TransactionUtil.TransactionGroup transactionGroup =
        TransactionUtil.startTransactionsOnSelectedModelRoots("New Instance");
    try {
      // Ensure that actions take place between Verifier Activity executions
      Ooaofooa.beginSaveOperation();
      if (((v_sequence != null))) {

        if (v_sequence != null) {
          v_sequence.Newclassinstance();
        } else {
          Throwable t = new Throwable();
          t.fillInStackTrace();
          CorePlugin.logError("Attempted to call an operation on a null instance.", t);
        }
      }

      // end critical section
      Ooaofooa.endSaveOperation();
      // catch all exceptions and cancel the transactions
    } catch (Exception e) {
      Ooaofooa.endSaveOperation();
      TransactionUtil.cancelTransactions(transactionGroup, e);
      CorePlugin.logError("Transaction: New Instance failed", e); // $NON-NLS-1$
    }
    TransactionUtil.endTransactions(transactionGroup);
  }
 /** @see IModelClassInspector#getParent(Object) Returns the parent(s) of this node */
 public Object getParent(Object arg) {
   Sequence_c result1 =
       Sequence_c.getOneSQ_SOnR929(
           InteractionParticipant_c.getOneSQ_POnR930((FunctionPackageParticipant_c) arg));
   if (result1 != null) {
     return result1;
   }
   Communication_c result2 =
       Communication_c.getOneCOMM_COMMOnR1126(
           ParticipantInCommunication_c.getOneCOMM_PICOnR1126(
               InteractionParticipant_c.getOneSQ_POnR930((FunctionPackageParticipant_c) arg)));
   if (result2 != null) {
     return result2;
   }
   return null; // No parent found
 }