Package net.sf.rej.gui.action

Examples of net.sf.rej.gui.action.InsertCodeAction


      Object row = this.list.getSelectedValue();
      if (row instanceof CodeRow) {
        // before selected instruction
        CodeRow cr = (CodeRow) row;
        int pos = cr.getPosition();
        InsertCodeAction ica = new InsertCodeAction(this.classDef
            .getClassFile(), cr.getParentCode(), pos, (Code) data);
        SystemFacade.getInstance().performAction(ica);
      } else if (row instanceof MethodDefRow) {
        MethodDefRow mdr = (MethodDefRow) row;
        if (mdr.isClosing()) {
          // at the end of the code block
          CodeAttribute ca = mdr.getMethod().getAttributes()
              .getCode();
          Code code = ca.getCode();
          InsertCodeAction ica = new InsertCodeAction(this.classDef
              .getClassFile(), code, code.getMaxPC(), (Code) data);
          SystemFacade.getInstance().performAction(ica);
        } else {
          // at the beginning of the code block
          CodeAttribute ca = mdr.getMethod().getAttributes()
              .getCode();
          Code code = ca.getCode();
          InsertCodeAction ica = new InsertCodeAction(this.classDef
              .getClassFile(), code, 0, (Code) data);
          SystemFacade.getInstance().performAction(ica);
        }
      }
    }
View Full Code Here

TOP

Related Classes of net.sf.rej.gui.action.InsertCodeAction

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.