本文整理汇总了Java中org.eclipse.ui.internal.util.BundleUtility.find方法的典型用法代码示例。如果您正苦于以下问题:Java BundleUtility.find方法的具体用法?Java BundleUtility.find怎么用?Java BundleUtility.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.internal.util.BundleUtility
的用法示例。
在下文中一共展示了BundleUtility.find方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
示例7: 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);
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}