?? treeimages.java
字號(hào):
/*******************************************************************************
* Copyright (c) 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package cn.com.javachen.myxml.xmltree;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
/**
* @since 3.2
*
*/
public class TreeImages {
private final static String ICONS_PATH = "icons/";
private final static String FLOWDER = "FLOWDER";
private final static String URLIMAGE = "URLIMAGE";
private static ImageRegistry imageRegistry;
/**
* @return imageRegistry
*/
public static ImageRegistry getImageRegistry() {
if (imageRegistry == null) {
imageRegistry = new ImageRegistry();
declareImages();// 注冊(cè)圖像
}
return imageRegistry;
}
/**
*
*/
private final static void declareImages() {
// TODO Auto-generated method stub
declareRegistryImage(FLOWDER, ICONS_PATH + "fldr_obj.gif");
declareRegistryImage(URLIMAGE, ICONS_PATH + "gel_sc_obj.gif");
}
/**
*
*/
private static void declareRegistryImage(String key, String path) {
// TODO Auto-generated method stub
ImageDescriptor desc = ImageDescriptor.createFromFile(
TreeImages.class, path);
imageRegistry.put(key, desc);
}
/**
* @param key
* @return Image
*/
public static Image getImage(String key){
return getImageRegistry().get(key);
}
/**
* @param key
* @return ImageDescriptor
*/
public static ImageDescriptor getImageDescriptor(String key){
return getImageRegistry().getDescriptor(key);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -