Пример #1
0
  void initialize() {
    int start, end;

    TextField txt = (TextField) target;

    setText(txt.getText());
    if (txt.echoCharIsSet()) {
      setEchoChar(txt.getEchoChar());
    }

    start = txt.getSelectionStart();
    end = txt.getSelectionEnd();

    if (end > start) {
      select(start, end);
    } else {
      setCaretPosition(start);
    }

    if (!target.isBackgroundSet()) {
      // This is a way to set the background color of the TextArea
      // without calling setBackground - go through native C code
      setTargetBackground(SystemColor.text);
    }
    if (!target.isForegroundSet()) {
      target.setForeground(SystemColor.textText);
    }

    setEditable(txt.isEditable());

    //	oldSelectionStart = -1; // accessibility support
    //	oldSelectionEnd = -1;	// accessibility support

    super.initialize();
  }
Пример #2
0
 void initialize() {
   Choice opt = (Choice) target;
   int itemCount = opt.countItems();
   String[] items = new String[itemCount];
   for (int i = 0; i < itemCount; i++) {
     items[i] = opt.getItem(i);
   }
   if (itemCount > 0) {
     appendItems(items);
     pSelect(opt.getSelectedIndex(), true);
   }
   super.initialize();
 }
Пример #3
0
 protected void disposeImpl() {
   freeNativeData();
   super.disposeImpl();
 }
Пример #4
0
 void pDispose() {
   notifyTextComponentChange(false);
   super.pDispose();
 }
Пример #5
0
 void pHide() {
   notifyTextComponentChange(false);
   super.pHide();
 }
Пример #6
0
 void pShow() {
   super.pShow();
   notifyTextComponentChange(true);
 }
Пример #7
0
 protected void disposeImpl() {
   preDispose();
   super.disposeImpl();
 }