org.eclipse.swt.widgets.DateTime.addListener()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中org.eclipse.swt.widgets.DateTime.addListener()方法的一些代码示例,展示了DateTime.addListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateTime.addListener()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.DateTime
类名称:DateTime
方法名:addListener

DateTime.addListener介绍

暂无

代码示例

代码示例来源:origin: atdl4j/atdl4j

public void addListener(Listener listener)
{
  if ( showMonthYear )
  {
    dateClock.addListener( SWT.Selection, listener );
  }
  if ( showTime )
  {
    timeClock.addListener( SWT.Selection, listener );
  }
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection, typedListener);
addListener (SWT.DefaultSelection, typedListener);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection, typedListener);
addListener (SWT.DefaultSelection, typedListener);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection, typedListener);
addListener (SWT.DefaultSelection, typedListener);

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

addListener( SWT.Selection, typedListener );
addListener( SWT.DefaultSelection, typedListener );

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection, typedListener);
addListener (SWT.DefaultSelection, typedListener);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection, typedListener);
addListener (SWT.DefaultSelection, typedListener);

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

popupCalendar.addListener (SWT.Selection, new Listener() {
  public void handleEvent(Event event) {
    int year = popupCalendar.getYear ();
addListener (SWT.Dispose, new Listener() {
  public void handleEvent(Event event) {
    if (popupShell != null && !popupShell.isDisposed ()) {
addListener(SWT.FocusOut, new Listener() {
  public void handleEvent(Event event) {
    hideCalendar();

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

void createPopupShell (int year, int month, int day) {
  popupShell = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP);
  popupCalendar = new DateTime (popupShell, SWT.CALENDAR);
  if (font != null) popupCalendar.setFont (font);
  if (fg != null) popupCalendar.setForeground (fg);
  if (bg != null) popupCalendar.setBackground (bg);

  mouseEventListener = new Listener () {
    @Override
    public void handleEvent (Event event) {
      if (event.widget instanceof Control) {
        Control c = (Control)event.widget;
        if (c != down && c.getShell () != popupShell)
          dropDownCalendar (false);
      }
    }
  };

  int [] listeners = {SWT.Close, SWT.MouseUp, SWT.Paint};
  for (int i=0; i < listeners.length; i++) {
    popupShell.addListener (listeners [i], popupListener);
  }
  listeners = new int [] {SWT.MouseDown, SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut, SWT.Dispose};
  for (int i=0; i < listeners.length; i++) {
    popupCalendar.addListener (listeners [i], popupListener);
  }
  addListener (SWT.Dispose, popupListener);
  if (year != -1) popupCalendar.setDate (year, month, day);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

void createPopupShell (int year, int month, int day) {
  popupShell = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP);
  popupCalendar = new DateTime (popupShell, SWT.CALENDAR);
  if (font != null) popupCalendar.setFont (font);
  if (fg != null) popupCalendar.setForeground (fg);
  if (bg != null) popupCalendar.setBackground (bg);

  mouseEventListener = new Listener () {
    @Override
    public void handleEvent (Event event) {
      if (event.widget instanceof Control) {
        Control c = (Control)event.widget;
        if (c != down && c.getShell () != popupShell)
          dropDownCalendar (false);
      }
    }
  };

  int [] listeners = {SWT.Close, SWT.MouseUp, SWT.Paint};
  for (int i=0; i < listeners.length; i++) {
    popupShell.addListener (listeners [i], popupListener);
  }
  listeners = new int [] {SWT.MouseDown, SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut, SWT.Dispose};
  for (int i=0; i < listeners.length; i++) {
    popupCalendar.addListener (listeners [i], popupListener);
  }
  addListener (SWT.Dispose, popupListener);
  if (year != -1) popupCalendar.setDate (year, month, day);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

void createPopupShell (int year, int month, int day) {
  popupShell = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP);
  popupCalendar = new DateTime (popupShell, SWT.CALENDAR);
  if (font != null) popupCalendar.setFont (font);
  if (fg != null) popupCalendar.setForeground (fg);
  if (bg != null) popupCalendar.setBackground (bg);

  mouseEventListener = new Listener () {
    @Override
    public void handleEvent (Event event) {
      if (event.widget instanceof Control) {
        Control c = (Control)event.widget;
        if (c != down && c.getShell () != popupShell)
          dropDownCalendar (false);
      }
    }
  };

  int [] listeners = {SWT.Close, SWT.MouseUp, SWT.Paint};
  for (int i=0; i < listeners.length; i++) {
    popupShell.addListener (listeners [i], popupListener);
  }
  listeners = new int [] {SWT.MouseDown, SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut, SWT.Dispose};
  for (int i=0; i < listeners.length; i++) {
    popupCalendar.addListener (listeners [i], popupListener);
  }
  addListener (SWT.Dispose, popupListener);
  if (year != -1) popupCalendar.setDate (year, month, day);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

createDropDownButton ();
createPopupShell (-1, -1, -1);
addListener (SWT.Resize, new Listener () {
  @Override
  public void handleEvent (Event event) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

createDropDownButton ();
createPopupShell (-1, -1, -1);
addListener (SWT.Resize, new Listener () {
  @Override
  public void handleEvent (Event event) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

createDropDownButton ();
createPopupShell (-1, -1, -1);
addListener (SWT.Resize, new Listener () {
  @Override
  public void handleEvent (Event event) {

相关文章

DateTime类方法