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

x33g5p2x  于2022-01-25 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(157)

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

暂无

代码示例

代码示例来源:origin: caoxinyu/RedisClient

@Override
  public void widgetSelected(SelectionEvent e) {
    Favorite favorite = (Favorite) menuItem
        .getData(FAVORITE);
    int sid = favorite.getServerID();
    String[] containers = favorite.getFavorite().split(":");
    String container = "";
    for (int i = 2; i < containers.length; i++) {
      container += containers[i] + ":";
    }
    TreeItem selected = gotoDBContainer(sid, Integer
        .parseInt(containers[1].replaceFirst(DB_PREFIX,
            "")), container, favorite.isData(),
        false);
    history.add(selected);
    btnBackward.setEnabled(true);
    btnForward.setEnabled(false);
  }
});

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
 public void handleEvent(Event event) {
  MenuItem item = (MenuItem)event.widget;
  assignSelectedToCategory((Category)item.getData("Category"));
 }
});

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
 public void handleEvent(Event event) {
  MenuItem item = (MenuItem)event.widget;
  assignSelectedToCategory((Category)item.getData("Category"));
 }
});

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void handleEvent(Event event) {
    MenuItem item = (MenuItem)event.widget;
    assignSelectedToCategory((Category)item.getData("Category"),files);
  }
});

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
 public void handleEvent(Event event) {
  MenuItem item = (MenuItem)event.widget;
  assignSelectedToCategory((Category)item.getData("Category"));
 }
});

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
 public void handleEvent(Event event) {
  MenuItem item = (MenuItem)event.widget;
  assignSelectedToCategory((Category)item.getData("Category"));
 }
});

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

public void handleMenuAction(MenuItem item) {
  Object obj = item.getData();
  if (obj != null) {
    logger.info(obj);
  }
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void handleEvent(Event e) {
    if (e.widget != null && e.widget instanceof MenuItem) {
      MenuItem item = (MenuItem) e.widget;
      int speed = item.getData("maxul") == null ? 0 : ((Integer) item
          .getData("maxul")).intValue();
      adapter.setUpSpeed(speed);
    }
  }
};

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void handleEvent(Event e) {
    if (e.widget != null && e.widget instanceof MenuItem) {
      MenuItem item = (MenuItem) e.widget;
      int speed = item.getData("maxdl") == null ? 0 : ((Integer) item
          .getData("maxdl")).intValue();
      adapter.setDownSpeed(speed);
    }
  }
};

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private static int getSelection(List<MenuItem> items) {
  for (MenuItem item : items) {
    if (item.getSelection())
      return ((Integer) item.getData()).intValue();
  }
  throw new AssertionError("No item selected"); //$NON-NLS-1$
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void
  widgetSelected(
    SelectionEvent e )
  {
    beta.setPrivateChatState((Integer)((MenuItem)e.widget).getData());
  }
};

代码示例来源:origin: org.codehaus.openxma/xmartserver

/**
 * Event-method called, when an item in the menu is selected. Calls the
 * Task of the corresponding MenuItem.
 *
 */
protected void menuWSelected(MenuItem aMenuItem) {
  IMenuItem xmaMenuItem = (IMenuItem) aMenuItem.getData();
  if(xmaMenuItem != null){
    callMenu(xmaMenuItem);
  }
}

代码示例来源:origin: org.codehaus.openxma/xmartclient

/**
 * Event-method called, when an item in the menu is selected. Calls the
 * Task of the corresponding MenuItem.
 *
 */
protected void menuWSelected(MenuItem aMenuItem) {
  IMenuItem xmaMenuItem = (IMenuItem) aMenuItem.getData();
  if(xmaMenuItem != null){
    callMenu(xmaMenuItem);
  }
}

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

public void widgetSelected(SelectionEvent e) {
    MenuItem menuItem = (MenuItem)e.widget;
    int index = indexOf((CTabItem)menuItem.getData(id));
    CTabFolder.this.setSelection(index, true);
  }
});

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

@Override
 public void widgetSelected( SelectionEvent event ) {
  MenuItem menuItem = ( MenuItem )event.getSource();
  int index = indexOf( ( CTabItem )menuItem.getData( id ) );
  setSelection( index, true );
 }
} );

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

/**
 * Refreshes the selected menu items to match the current state of the model.
 */
private void refreshSelection() {
  Iterator iter = items.iterator();
  while (iter.hasNext()) {
    MenuItem next = (MenuItem) iter.next();
    if (!next.isDisposed()) {
      next.setSelection(isEqual(data.getState(), next.getData()));
    }
  }
}

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-verification-ui

public void widgetSelected(SelectionEvent event) {
    // The menu item has a data object that contains the string to add
    List<String> list = session.getParameters().getExtraCodesAllowed();
    String code = (String)((MenuItem)event.getSource()).getData();
    if ( list.contains(code) ) return;
    list.add(code);
    session.setModified(true); // We have modified the session data
  }
};

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-verification-ui

public void widgetSelected(SelectionEvent event) {
    // The menu item has a data object that contains the string to add
    List<String> list = session.getParameters().getMissingCodesAllowed();
    String code = (String)((MenuItem)event.getSource()).getData();
    if ( list.contains(code) ) return;
    list.add(code);
    session.setModified(true); // We have modified the session data
  }
};

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void
  menuShown(
    MenuEvent e )
  {
    int vt = chat.getViewType();
    
    for ( MenuItem mi: vt_menu.getItems()){
      mi.setSelection( vt == (Integer)mi.getData());
    }
  }
});

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void
  menuShown(
    MenuEvent e )
  {
    int pc_state = beta.getPrivateChatState();
    for ( MenuItem mi: status_priv_menu.getItems()){
      mi.setSelection( pc_state == (Integer)mi.getData());
    }
  }
});

相关文章