gpt4 book ai didi

org.eclipse.ui.internal.WorkbenchImages.getImage()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 13:51:05 28 4
gpt4 key购买 nike

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

WorkbenchImages.getImage介绍

[英]Returns the image stored in the workbench plugin's image registry under the given symbolic name. If there isn't any value associated with the name then null is returned. The returned Image is managed by the workbench plugin's image registry. Callers of this method must not dispose the returned image. This method is essentially a convenient short form of WorkbenchImages.getImageRegistry.get(symbolicName).
[中]返回以给定符号名存储在workbench插件的图像注册表中的图像。如果没有任何与名称关联的值,则返回null。返回的图像由workbench插件的图像注册表管理。此方法的调用方不能处理返回的映像。这种方法本质上是一种方便的工作台简化形式。getImageRegistry。获取(symbolicName)。

代码示例

代码示例来源:origin: org.eclipse.mylyn.commons.repositories/ui

@Override
public Image getImage(Object object) {
  if (object instanceof RepositoryCategory) {
    return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
  }
  return null;
}

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

/**
 * Retrieves the specified image from the workbench plugin's image registry.
 *
 * @see ISharedImages
 */
@Override
public Image getImage(String symbolicName) {
  Image image = WorkbenchImages.getImage(symbolicName);
  if (image != null) {
    return image;
  }
  //if there is a descriptor for it, add the image to the registry.
  ImageDescriptor desc = WorkbenchImages.getImageDescriptor(symbolicName);
  if (desc != null) {
    WorkbenchImages.getImageRegistry().put(symbolicName, desc);
    return WorkbenchImages.getImageRegistry().get(symbolicName);
  }
  return null;
}

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

public Image getFolderImage() {
  return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
}

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

private Image getImage(Object element) {
  if (element instanceof ItemsListSeparator) {
    return WorkbenchImages
        .getImage(IWorkbenchGraphicConstants.IMG_OBJ_SEPARATOR);
  }
  return provider.getImage(element);
}

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

@Override
public Image getImage(Object element) {
  if (element instanceof ArtifactFolder) {
    return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
  } else if (element instanceof IArtifact) {
    return imageManager.getFileImage(((IArtifact) element).getName());
  }
  return null;
}

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

@Override
public Image getColumnImage(Object element, int columnIndex) {
  if (columnIndex == 0) {
    if (element instanceof AboutBundleData) {
      final AboutBundleData data = (AboutBundleData) element;
      if (data.isSignedDetermined()) {
        return WorkbenchImages
            .getImage(data.isSigned() ? IWorkbenchGraphicConstants.IMG_OBJ_SIGNED_YES
                : IWorkbenchGraphicConstants.IMG_OBJ_SIGNED_NO);
      }
      synchronized (resolveQueue) {
        resolveQueue.add(data);
      }
      resolveJob.schedule();
      return WorkbenchImages
          .getImage(IWorkbenchGraphicConstants.IMG_OBJ_SIGNED_UNKNOWN);
    }
  }
  return null;
}

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

Image getImage(QuickAccessElement element, ResourceManager resourceManager) {
  Image image = findOrCreateImage(element.getImageDescriptor(),
      resourceManager);
  if (image == null) {
    image = WorkbenchImages
        .getImage(IWorkbenchGraphicConstants.IMG_OBJ_ELEMENT);
  }
  return image;
}

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

public Image getFileImage(String filename) {
  if (filename != null) {
    int dotIndex = filename.lastIndexOf('.');
    if (dotIndex != -1) {
      String fileType = filename.substring(dotIndex + 1);
      for (String element2 : IMAGE_EXTENSIONS) {
        if (element2.equalsIgnoreCase(fileType)) {
          return CommonImages.getImage(CommonImages.IMAGE_FILE);
        }
      }
    }
    String file = new Path(filename).lastSegment();
    if (file != null) {
      return getImage(PlatformUI.getWorkbench().getEditorRegistry().getImageDescriptor(filename));
    }
  }
  return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FILE);
}

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

private String getSeparatorLabel(String separatorLabel) {
  Rectangle rect = list.getTable().getBounds();
  int borderWidth = list.getTable().computeTrim(0, 0, 0, 0).width;
  int imageWidth = WorkbenchImages.getImage(
      IWorkbenchGraphicConstants.IMG_OBJ_SEPARATOR).getBounds().width;
  int width = rect.width - borderWidth - imageWidth;
  GC gc = new GC(list.getTable());
  gc.setFont(list.getTable().getFont());
  int fSeparatorWidth = gc.getAdvanceWidth('-');
  int fMessageLength = gc.textExtent(separatorLabel).x;
  gc.dispose();
  StringBuilder dashes = new StringBuilder();
  int chars = (((width - fMessageLength) / fSeparatorWidth) / 2) - 2;
  for (int i = 0; i < chars; i++) {
    dashes.append('-');
  }
  StringBuilder result = new StringBuilder();
  result.append(dashes);
  result.append(" " + separatorLabel + " "); //$NON-NLS-1$//$NON-NLS-2$
  result.append(dashes);
  return result.toString().trim();
}

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

private Button createDropdownButton(final Composite parent, int id, String label, MouseListener mouseListener) {
  char textEmbedding = parent.getOrientation() == SWT.LEFT_TO_RIGHT ? '\u202a' : '\u202b';
  Button button = createButton(parent, id, textEmbedding + label + '\u202c', false);
  if (Util.isMac()) {
    // Button#setOrientation(int) is a no-op on the Mac. Use a Unicode BLACK DOWN-POINTING SMALL TRIANGLE.
    button.setText(button.getText() + " \u25BE"); //$NON-NLS-1$
  } else {
    int dropDownOrientation = parent.getOrientation() == SWT.LEFT_TO_RIGHT ? SWT.RIGHT_TO_LEFT : SWT.LEFT_TO_RIGHT;
    button.setOrientation(dropDownOrientation);
    button.setImage(WorkbenchImages.getImage(IWorkbenchGraphicConstants.IMG_LCL_BUTTON_MENU));
    button.addMouseListener(mouseListener);
  }
  return button;
}

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

.getImage(IWorkbenchGraphicConstants.IMG_LCL_VIEW_MENU));
toolItem
    .setToolTipText(WorkbenchMessages.FilteredItemsSelectionDialog_menu);

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

.getImage(IWorkbenchGraphicConstants.IMG_LCL_VIEW_MENU);
toolItem.setImage(hoverImage);
item.setText("Ipsum"); //$NON-NLS-1$
item.setControl(viewForm);
item.setImage(WorkbenchImages.getImage(ISharedImages.IMG_TOOL_COPY));

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com