本文整理匯總了Java中org.eclipse.jface.resource.ImageDescriptor.createFromFile方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageDescriptor.createFromFile方法的具體用法?Java ImageDescriptor.createFromFile怎麽用?Java ImageDescriptor.createFromFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.resource.ImageDescriptor
的用法示例。
在下文中一共展示了ImageDescriptor.createFromFile方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: makeDescriptor
import org.eclipse.jface.resource.ImageDescriptor; //導入方法依賴的package包/類
private ImageDescriptor makeDescriptor ( final String icon )
{
if ( "info".equalsIgnoreCase ( icon ) )
{
return ImageDescriptor.createFromFile ( SystemMessageExtension.class, "icons/information.png" );
}
else if ( "warning".equalsIgnoreCase ( icon ) )
{
return ImageDescriptor.createFromFile ( SystemMessageExtension.class, "icons/exclamation.png" );
}
return ImageDescriptor.getMissingImageDescriptor ();
}
示例2: createConsoles
import org.eclipse.jface.resource.ImageDescriptor; //導入方法依賴的package包/類
private void createConsoles() {
ConsolePlugin consolePlugin = ConsolePlugin.getDefault();
IConsoleManager consoleManager = consolePlugin.getConsoleManager();
stdoutConsole = new MessageConsole("Stdout", ImageDescriptor.createFromFile(getClass(), "/consoles/stdout.gif"));
stdoutConsole.setTabWidth(TAB_WIDTH);
stdoutConsoleStream = stdoutConsole.newMessageStream();
stderrConsoleStream = stdoutConsole.newMessageStream();
stderrConsoleStream.setColor(stderrConsoleStreamColor);
engineConsole = new MessageConsole("Engine", ImageDescriptor.createFromFile(getClass(), "/consoles/engine.gif"));
engineConsole.setTabWidth(TAB_WIDTH);
engineConsoleStream = engineConsole.newMessageStream();
consoleManager.addConsoles(new IConsole[] {
engineConsole,
stdoutConsole
});
consolePipes = new ConsolePipes();
debugConsoleStream = new MessageConsoleStream(engineConsole) {
@Override
public void write(String str) throws IOException {
if (str.endsWith("\n")) {
str = str.substring(0, str.length() - 1);
}
Engine.logStudio.info("[debug] " + str);
}
};
}
示例3: RemoveAction
import org.eclipse.jface.resource.ImageDescriptor; //導入方法依賴的package包/類
public RemoveAction ( final RealtimeListAdapter view )
{
super ( Messages.RemoveAction_Name, ImageDescriptor.createFromFile ( RemoveAction.class, "icons/delete_obj.gif" ) );
this.view = view;
}