当前位置: 首页>>代码示例>>Java>>正文


Java BundleUtility类代码示例

本文整理汇总了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;
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:19,代码来源:ELTHydroSubGroup.java

示例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;
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:18,代码来源:AguiPlugin.java

示例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);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:26,代码来源:LocalizeDialog.java

示例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);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:28,代码来源:CustomEditActionProvider.java

示例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();
		}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:PinFigure.java

示例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;
}
 
开发者ID:SEMERU-WM,项目名称:ChangeScribe,代码行数:10,代码来源:ProjectInformation.java

示例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")));
}
 
开发者ID:turesheim,项目名称:eclipse-timekeeper,代码行数:8,代码来源:TimekeeperUiPlugin.java

示例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);

}
 
开发者ID:SENSIDL-PROJECT,项目名称:SensIDL,代码行数:11,代码来源:SensidlWizard.java

示例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);
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:10,代码来源:CuinaCore.java

示例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);

}
 
开发者ID:eclipse,项目名称:eavp,代码行数:24,代码来源:ActionReplicateShape.java

示例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);

}
 
开发者ID:eclipse,项目名称:eavp,代码行数:25,代码来源:ActionDeleteShape.java

示例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);

}
 
开发者ID:eclipse,项目名称:eavp,代码行数:18,代码来源:ActionDuplicateShape.java

示例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);
			
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:9,代码来源:PhMRpActions.java

示例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);

}
 
开发者ID:eclipse,项目名称:eavp,代码行数:27,代码来源:DropdownAction.java


注:本文中的org.eclipse.ui.internal.util.BundleUtility类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。