Package net.sf.rej.gui.editor

Examples of net.sf.rej.gui.editor.BasicInfoEditor


  public void launchEditor(final ConstantPoolInfo cpi) {
    if (cpi.getType() == ConstantPoolInfo.CLASS) {
      // TODO: constant chooser
    }

    BasicInfoEditor bie = new BasicInfoEditor(MainWindow.getInstance()) {

      @Override
      public void validate(String value)
          throws BasicInfoEditor.ValidationException {
        validateAndStore(cpi, value);
      }

    };
    switch (cpi.getType()) {
    case ConstantPoolInfo.UTF8:
      bie.invoke("Edit UTF-8 Info", cpi.getValue());
      break;
    case ConstantPoolInfo.DOUBLE:
      DoubleInfo di = (DoubleInfo) cpi;
      bie.invoke("Edit Double Info", String.valueOf(di.getDoubleValue()));
      break;
    case ConstantPoolInfo.FLOAT:
      FloatInfo fi = (FloatInfo) cpi;
      bie.invoke("Edit Float Info", String.valueOf(fi.getFloatValue()));
      break;
    case ConstantPoolInfo.INTEGER:
      IntegerInfo ii = (IntegerInfo) cpi;
      bie.invoke("Edit Integer Info", String.valueOf(ii.getIntValue()));
      break;
    case ConstantPoolInfo.LONG:
      LongInfo li = (LongInfo) cpi;
      bie.invoke("Edit Long Info", String.valueOf(li.getLongValue()));
      break;
    case ConstantPoolInfo.STRING:
      StringInfo si = (StringInfo) cpi;
      bie.invoke("Edit String Info", si.getStringValue());
      break;

    }

  }
View Full Code Here


    switch (selection) {
    case -1:
      // no selection
      break;
    case 0: {// String
      BasicInfoEditor bie = new BasicInfoEditor(MainWindow.getInstance()) {

        @Override
        public void validate(String value)
            throws BasicInfoEditor.ValidationException {
          validateAndInsertStringInfo(value);
        }

      };
      bie.invoke("Insert String Constant", "");
      break;
    }
    case 1: {// int
      BasicInfoEditor bie = new BasicInfoEditor(MainWindow.getInstance()) {

        @Override
        public void validate(String value)
            throws BasicInfoEditor.ValidationException {
          validateAndInsertIntegerInfo(value);
        }

      };
      bie.invoke("Insert Integer Constant", "");
      break;
    }
    case 2: {// long
      BasicInfoEditor bie = new BasicInfoEditor(MainWindow.getInstance()) {

        @Override
        public void validate(String value)
            throws BasicInfoEditor.ValidationException {
          validateAndInsertLongInfo(value);
        }

      };
      bie.invoke("Insert Integer Constant", "");
      break;
    }
    case 3: {// float
      BasicInfoEditor bie = new BasicInfoEditor(MainWindow.getInstance()) {

        @Override
        public void validate(String value)
            throws BasicInfoEditor.ValidationException {
          validateAndInsertFloatInfo(value);
        }

      };
      bie.invoke("Insert Integer Constant", "");
      break;
    }
    case 4: {// double
      BasicInfoEditor bie = new BasicInfoEditor(MainWindow.getInstance()) {

        @Override
        public void validate(String value)
            throws BasicInfoEditor.ValidationException {
          validateAndInsertDoubleInfo(value);
        }

      };
      bie.invoke("Insert Integer Constant", "");
      break;
    }
    default:
      // TODO: insert field, method
      throw new RuntimeException("To be implemented");
View Full Code Here

TOP

Related Classes of net.sf.rej.gui.editor.BasicInfoEditor

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.