Esempio n. 1
0
  private void handleHeaderSelection(VButton button) {
    if (monthButton != null && monthButton != button) {
      monthButton.setSelection(false);
    }
    if (yearButton != null && yearButton != button) {
      yearButton.setSelection(false);
    }
    if (timeButton != null && timeButton != button) {
      timeButton.setSelection(false);
    }

    if (button != null && button.getSelection()) {
      VPanel panel = button.getData(Key.Panel, VPanel.class);
      panel.getParent().getLayout(VStackLayout.class).setTopControl(panel, 500);
    } else {
      for (VPanel panel : bodyPanels) {
        panel.getLayout(VStackLayout.class).setTopControl(null, 500);
      }
    }
  }
Esempio n. 2
0
 private void setSelectionFromButton(VButton button, int stateMask) {
   Date date = (Date) button.getData(CDT.Key.Date.name());
   if (cdt.isSingleSelection()) {
     if ((stateMask & SWT.CTRL) != 0 && cdt.isSelected(date)) {
       cdt.setSelection(null);
     } else {
       cdt.setSelection(date);
     }
   } else {
     //			if((stateMask & SWT.CTRL) != 0) {
     //				if(cdt.isSelected(date)) {
     //					cdt.deselect(date);
     //				} else {
     //					cdt.select(date);
     //				}
     //			} else if((stateMask & SWT.SHIFT) != 0 && cdt.hasSelection()) {
     //				cdt.select(cdt.getSelection(), date, Calendar.DATE, 1);
     //			} else {
     cdt.setSelection(date);
     //			}
   }
   setFocus(true);
 }