本文整理汇总了Java中org.eclipse.ui.internal.util.BundleUtility类的典型用法代码示例。如果您正苦于以下问题:Java BundleUtility类的具体用法?Java BundleUtility怎么用?Java BundleUtility使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BundleUtility类属于org.eclipse.ui.internal.util包,在下文中一共展示了BundleUtility类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getImage
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
private Image getImage(String subgroupName){
Bundle bundle = Platform.getBundle("hydrograph.ui.propertywindow");
URL fullPathString = null;
if(StringUtils.equalsIgnoreCase(subgroupName, "CONFIGURATION")){
fullPathString = BundleUtility.find(bundle, "icons/config.png");
}else if(StringUtils.equalsIgnoreCase(subgroupName, "DISPLAY")){
fullPathString = BundleUtility.find(bundle, "icons/display.png");
}else if(StringUtils.equalsIgnoreCase(subgroupName, "RECORD STRUCTURE DETAILS")){
fullPathString = BundleUtility.find(bundle, "icons/schema.png");
}
if(fullPathString!=null){
Image image = ImageDescriptor.createFromURL(fullPathString).createImage();
return image;
}else{
return null;
}
}
示例2: getBundleAbsolutePath
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
public static URL getBundleAbsolutePath(String path) {
Bundle bundle = Platform.getBundle(PLUGIN_ID);
if (!BundleUtility.isReady(bundle)) {
return null;
}
// look for the image (this will check both the plugin and fragment folders
URL fullPathString = BundleUtility.find(bundle, path);
if (fullPathString == null) {
try {
fullPathString = new URL(path);
} catch (MalformedURLException e) {
return null;
}
}
return fullPathString;
}
示例3: addPluginsTab
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
private void addPluginsTab(TabFolder tabFolder) {
TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
languageSet.associate(tabItem, Messages.LocalizeDialog_TabTitle_Plugins);
AboutBundleData[] bundleInfos;
// create a data object for each bundle, remove duplicates, and include only resolved bundles (bug 65548)
Map map = new HashMap();
Bundle[] bundles = WorkbenchPlugin.getDefault().getBundles();
for (int i = 0; i < bundles.length; ++i) {
AboutBundleData data = new AboutBundleData(bundles[i]);
if (BundleUtility.isReady(data.getState()) && !map.containsKey(data.getVersionedId())) {
map.put(data.getVersionedId(), data);
}
}
bundleInfos = (AboutBundleData[]) map.values().toArray(
new AboutBundleData[0]);
Composite c = new Composite(tabFolder, SWT.NONE);
tabItem.setControl(c);
createPluginsTab(c, bundleInfos);
}
示例4: fillContextMenu
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
@SuppressWarnings("restriction")
@Override
public void fillContextMenu(IMenuManager menu) {
super.fillContextMenu(menu);
ActionContributionItem pasteContribution = getPasteContribution(menu.getItems());
menu.remove(pasteContribution);
IAction pasteAction = new Action(PASTE_ACTION_TEXT) {
@Override
public void run() {
IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench()
.getService(IHandlerService.class);
try {
JobCopyParticipant.setCopiedFileList(new ArrayList<>());
handlerService.executeCommand(PASTE_COMMAND_ID, null);
} catch (Exception exception) {
logger.warn("Error while pasting job files :: {}",exception.getMessage());
}
}
};
pasteAction.setAccelerator(SWT.MOD1 | 'v');
Bundle bundle = Platform.getBundle(MENU_PLUGIN_NAME);
URL imagePath = BundleUtility.find(bundle,ImagePathConstant.PASTE_IMAGE_PATH.getValue());
ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(imagePath);
pasteAction.setImageDescriptor(imageDescriptor);
menu.insertAfter(COPY_ACTION_ID, pasteAction);
}
示例5: PinFigure
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
public PinFigure() {
if (bimage == null)
try {
Bundle bundle = Platform.getBundle(JaspersoftStudioPlugin.PLUGIN_ID);
if (BundleUtility.isReady(bundle))
bimage = ImageIO.read(BundleUtility.find(bundle, "icons/pin-16.png"));
} catch (IOException e) {
e.printStackTrace();
}
}
示例6: getAbsoluteURL
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
public static String getAbsoluteURL(String path) {
Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
if (!BundleUtility.isReady(bundle)) {
return null;
}
String loc = bundle.getLocation();
loc = loc.substring(loc.indexOf("file:"), loc.length()).concat(path);
return loc;
}
示例7: initializeImageRegistry
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
@Override
protected void initializeImageRegistry(ImageRegistry reg) {
reg.put(OBJ_ACTIVITY, ImageDescriptor
.createFromURL(BundleUtility.find(getBundle(), "icons/full/eview/activity_obj.png")));
reg.put(IMG_TOOL_CURRENT, ImageDescriptor
.createFromURL(BundleUtility.find(getBundle(), "icons/full/elcl/cur_nav.png")));
}
示例8: addPages
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
@Override
public void addPages() {
Bundle bundle = Platform.getBundle("de.fzi.sensidl.language.ui");
URL fullPathString = BundleUtility.find(bundle, "images/SensIDL_logo.jpg");
sensidlWizardPage = new SensidlWizardPage("SensIDL - Code Generation", "SensIDL - Code Generation",
ImageDescriptor.createFromURL(fullPathString), modelPath, path, language, sensidlmodel != null);
addPage(sensidlWizardPage);
}
示例9: getImageDescriptor
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
public static ImageDescriptor getImageDescriptor(String imageName)
{
Bundle bundle = Platform.getBundle(PLUGIN_ID);
if (!BundleUtility.isReady(bundle)) { return null; }
URL fullPathString = BundleUtility.find(bundle, "icons/" + imageName);
return ImageDescriptor.createFromURL(fullPathString);
}
示例10: ActionReplicateShape
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
/**
* <p>
* Initializes the instance with the current ShapeTreeView
* </p>
*
* @param view
* <p>
* The current ShapeTreeView
* </p>
*/
public ActionReplicateShape(ShapeTreeView view) {
this.view = view;
this.setText("Replicate Shape");
// Load replicate.gif icon from the bundle's icons/ directory
Bundle bundle = FrameworkUtil.getBundle(getClass());
URL imagePath = BundleUtility.find(bundle, "icons/replicate.gif");
imageDescriptor = ImageDescriptor.createFromURL(imagePath);
}
示例11: ActionDeleteShape
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
/**
* <p>
* Constructor for setting the current ShapeTreeViewer
* </p>
*
* @param view
* <p>
* The current ShapeTreeView
* </p>
*/
public ActionDeleteShape(ShapeTreeView view) {
this.view = view;
this.setText("Delete Shape");
// Load the delete.gif ImageDescriptor from the bundle's
// `icons` directory
Bundle bundle = FrameworkUtil.getBundle(getClass());
URL imagePath = BundleUtility.find(bundle, "icons/delete.gif");
imageDescriptor = ImageDescriptor.createFromURL(imagePath);
}
示例12: ActionDuplicateShape
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
/**
*
* @param view
*/
public ActionDuplicateShape(ShapeTreeView view) {
this.view = view;
this.setText("Duplicate Shape");
// Load duplicate.gif icon from the bundle's icons/ directory
Bundle bundle = FrameworkUtil.getBundle(getClass());
URL imagePath = BundleUtility.find(bundle, "icons/duplicate.gif");
imageDescriptor = ImageDescriptor.createFromURL(imagePath);
}
示例13: createImageDescriptor
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
private ImageDescriptor createImageDescriptor() {
Bundle bundle = Platform.getBundle("ch.pharmed.phmprescriber"); //$NON-NLS-1$
URL fullPathString = BundleUtility.find(bundle, "icons/logo_elexis.png"); //$NON-NLS-1$
return ImageDescriptor.createFromURL(fullPathString);
}
示例14: DropdownAction
import org.eclipse.ui.internal.util.BundleUtility; //导入依赖的package包/类
/**
* <p>
* Creates a dropdown action with an icon label
* </p>
*
* @param text
* <p>
* The tooltip text
* </p>
* @param imageFilename
* <p>
* The filename of the icon image, relative to the OSGi bundle
* location
* </p>
*/
public DropdownAction(String text, String imageFilename) {
this(text);
// Load the icon image
Bundle bundle = FrameworkUtil.getBundle(getClass());
URL imagePath = BundleUtility.find(bundle, imageFilename);
imageDescriptor = ImageDescriptor.createFromURL(imagePath);
}