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

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

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

暂无

代码示例

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

static void writeImage( final MenuItem item ) throws IOException {
 Image image = item.getImage();
 if( WidgetLCAUtil.hasChanged( item, Props.IMAGE, image, null ) ) {
  String imagePath = ImageFactory.getImagePath( image );
  JSWriter writer = JSWriter.getWriterFor( item );
  Rectangle bounds = image != null ? image.getBounds() : null;
  Object[] args = new Object[]{
   imagePath,
   new Integer( bounds != null ? bounds.width : 0 ),
   new Integer( bounds != null ? bounds.height : 0 )
  };
  writer.set( "image", args );
 }
}

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

private void prepareDrowpdown(ToolItem dropDown, String dropDownLabel, MenuItem mostPopularItem) {
    dropDown.setToolTipText(dropDownLabel + mostPopularItem.getText());
    dropDown.setImage(mostPopularItem.getImage());
    dropDown.setEnabled(true);
  }
};

代码示例来源:origin: com.eclipsesource.tabris/tabris

@Override
 public void handleEvent( Event event ) {
  MenuItem item = ( MenuItem )event.widget;
  PageDescriptor pageDescriptor = ( PageDescriptor )item.getData();
  ToolItem dropDown = pageSwitcher.getItem( 0 );
  dropDown.setText( item.getText() );
  dropDown.setData( pageDescriptor );
  dropDown.setImage( item.getImage() );
  if( !DATA_ACTIVATED.equals( event.data ) ) {
   ui.getPageOperator().openPage( pageDescriptor.getId() );
  }
 }
}

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

@Override
protected void updateWidget() {
  String value= getPreferences().get(getKey());
  int wrappingStyle= DefaultCodeFormatterConstants.getWrappingStyle(value);
  boolean wrapEnabled= wrappingStyle != DefaultCodeFormatterConstants.WRAP_NO_SPLIT;
  MenuItem wrapStyleItem= updateMenuItem(fWrapStyleItems, wrappingStyle);
  fWrapStyleDropDown.setToolTipText(FormatterMessages.FormatterModifyDialog_lineWrap_wrapping_policy_label + wrapStyleItem.getText());
  fWrapStyleDropDown.setImage(wrapStyleItem.getImage());
  boolean forceWrapping= DefaultCodeFormatterConstants.getForceWrapping(value);
  fForceSplitItem.setSelection(forceWrapping);
  fForceSplitItem.setEnabled(wrapEnabled);
  MenuItem indentStyleItem= updateMenuItem(fIndentationItems, DefaultCodeFormatterConstants.getIndentStyle(value));
  fIndentationDropDown.setToolTipText(FormatterMessages.FormatterModifyDialog_lineWrap_indentation_policy_label + indentStyleItem.getText());
  fIndentationDropDown.setImage(indentStyleItem.getImage());
  fIndentationDropDown.setDisabledImage((Image) indentStyleItem.getData(DATA_IMAGE_DISABLED));
  fIndentationDropDown.setEnabled(wrapEnabled);
  if (fWrapBeforeKey != null) {
    int wrapBeforeAfterValue= WRAP_BEFORE_PREF_VALUES.indexOf(getPreferences().get(fWrapBeforeKey));
    MenuItem wrapBeforeAfterItem= updateMenuItem(fWrapBeforeAfterItems, wrapBeforeAfterValue);
    fWrapBeforeAfterDropDown.setToolTipText(wrapBeforeAfterItem.getText());
    fWrapBeforeAfterDropDown.setImage(wrapBeforeAfterItem.getImage());
    fWrapBeforeAfterDropDown.setDisabledImage((Image) wrapBeforeAfterItem.getData(DATA_IMAGE_DISABLED));
    fWrapBeforeAfterDropDown.setEnabled(wrapEnabled);
  }
}

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

@Override
public void preserveValues( MenuItem item ) {
 preserveProperty( item, PROP_TEXT, item.getText() );
 preserveProperty( item, PROP_IMAGE, item.getImage() );
 preserveProperty( item, PROP_MENU, item.getMenu() );
 preserveProperty( item, PROP_ENABLED, item.getEnabled() );
 preserveProperty( item, PROP_SELECTION, item.getSelection() );
}

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

@Override
public void renderChanges( MenuItem item ) throws IOException {
 WidgetLCAUtil.renderCustomVariant( item );
 WidgetLCAUtil.renderData( item );
 renderText( item );
 renderMnemonicIndex( item );
 renderProperty( item, PROP_IMAGE, item.getImage(), null );
 WidgetLCAUtil.renderMenu( item, item.getMenu() );
 renderProperty( item, PROP_ENABLED, item.getEnabled(), true );
 renderProperty( item, PROP_SELECTION, item.getSelection(), false );
 renderListenSelection( item );
 renderListenHelp( item );
}

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

for (int i = 0; i < items.length; i++) {
  MenuItem item = items [i];
  if (item.getImage () != null && item.getData (ICON_KEY) == null) {
    directory = getDirectory (buffer);
    break;
          for (int j = 0; j < subItems.length; j++) {
            MenuItem subItem = subItems [j];
            if (subItem.getImage () != null && subItem.getData (ICON_KEY) == null) {
              directory = getDirectory (buffer);
              break;

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

if (text != null) index = Integer.parseInt (text);
} else {
  Image image = item.getImage ();
  if (image != null && directory != null) {
    icon = directory + "\\menu" + item.id + ".ico" ;

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

Image image = item.getImage();
if (image != null) {
  iconDescriptor = ImageDescriptor.createFromImage(image);

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

proxyItem.setAccelerator(realItem.getAccelerator());
proxyItem.setEnabled(realItem.getEnabled());
proxyItem.setImage(realItem.getImage());
proxyItem.setSelection(realItem.getSelection());
proxyItem.setText(realItem.getText());

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

proxyItem.setAccelerator(realItem.getAccelerator());
proxyItem.setEnabled(realItem.getEnabled());
proxyItem.setImage(realItem.getImage());
proxyItem.setSelection(realItem.getSelection());
proxyItem.setText(realItem.getText());

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

proxyItem.setAccelerator(realItem.getAccelerator());
proxyItem.setEnabled(realItem.getEnabled());
proxyItem.setImage(realItem.getImage());
proxyItem.setSelection(realItem.getSelection());
proxyItem.setText(realItem.getText());

相关文章