コード例 #1
0
 protected void hookMinOccur(SelectionAdapter adapter) {
   fMinOccurSpinner.addSelectionListener(adapter);
   fMinOccurSpinner.addModifyListener(
       new ModifyListener() {
         @Override
         public void modifyText(ModifyEvent e) {
           if (blockListeners()) return;
           int minOccur = fMinOccurSpinner.getSelection();
           if (minOccur > getMaxOccur()) fMinOccurSpinner.setSelection(minOccur - 1);
         }
       });
 }
コード例 #2
0
 protected void hookMaxOccur(SelectionAdapter adapter) {
   fUnboundSelect.addSelectionListener(adapter);
   fMaxOccurSpinner.addSelectionListener(adapter);
   fMaxOccurSpinner.addModifyListener(
       new ModifyListener() {
         @Override
         public void modifyText(ModifyEvent e) {
           if (blockListeners()) return;
           int maxValue = fMaxOccurSpinner.getSelection();
           if (maxValue < getMinOccur()) fMaxOccurSpinner.setSelection(maxValue + 1);
         }
       });
 }