本文整理汇总了Java中org.openide.util.ImageUtilities.loadImageIcon方法的典型用法代码示例。如果您正苦于以下问题:Java ImageUtilities.loadImageIcon方法的具体用法?Java ImageUtilities.loadImageIcon怎么用?Java ImageUtilities.loadImageIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.util.ImageUtilities
的用法示例。
在下文中一共展示了ImageUtilities.loadImageIcon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSelectionInfo
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
private void setSelectionInfo (String downloadSize, int count) {
String operationNameKey = null;
switch (model.getType ()) {
case INSTALLED :
operationNameKey = "UnitTab_OperationName_Text_INSTALLED";
break;
case UPDATE :
operationNameKey = "UnitTab_OperationName_Text_UPDATE";
break;
case AVAILABLE :
operationNameKey = "UnitTab_OperationName_Text_AVAILABLE";
break;
case LOCAL :
operationNameKey = "UnitTab_OperationName_Text_LOCAL";
break;
}
String key = count == 1 ? "UnitTab_lHowManySelected_Single_Text" : "UnitTab_lHowManySelected_Many_Text";
if (UnitCategoryTableModel.Type.INSTALLED == model.getType () || UnitCategoryTableModel.Type.LOCAL == model.getType ()) {
lSelectionInfo.setText ((NbBundle.getMessage (UnitTab.class, key, count)));
} else {
if (downloadSize == null) {
lSelectionInfo.setText ((NbBundle.getMessage (UnitTab.class, key, count)));
} else {
lSelectionInfo.setText (NbBundle.getMessage (UnitTab.class, "UnitTab_lHowManySelected_TextFormatWithSize",
NbBundle.getMessage (UnitTab.class, key, count), downloadSize));
}
}
if (model.needsRestart ()) {
Icon warningIcon = ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/ui/resources/warning.gif", false); // NOI18N
lWarning.setIcon (warningIcon);
lWarning.setText (NbBundle.getMessage (UnitTab.class, "UnitTab_lWarning_Text", NbBundle.getMessage (UnitTab.class, operationNameKey))); // NOI18N
}
}
示例2: rebuildToolbar
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
private void rebuildToolbar() {
toolbar.removeAll();
toolbar.setFocusable( false );
//scope buttons
List<TaskScanningScope> scopes = ScanningScopeList.getDefault().getTaskScanningScopes();
for( TaskScanningScope scope : scopes ) {
final ScopeButton scopeButton = new ScopeButton( taskManager, scope );
scopeButton.setSelected(scope.equals(Settings.getDefault().getActiveScanningScope()));
toolbar.add(scopeButton);
}
toolbar.add( new JToolBar.Separator() );
//filter
JToggleButton toggleFilter = new FiltersMenuButton( filters.getActive() );
toolbar.add( toggleFilter );
//grouping & other butons
toolbar.addSeparator();
final JToggleButton toggleGroups = new JToggleButton( ImageUtilities.loadImageIcon("org/netbeans/modules/tasklist/ui/resources/groups.png", false)); //NOI18N
toggleGroups.addItemListener( new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
switchTableModel( e.getStateChange() == ItemEvent.SELECTED );
Settings.getDefault().setGroupTasksByCategory( toggleGroups.isSelected() );
toggleGroups.setToolTipText( toggleGroups.isSelected()
? NbBundle.getMessage( TaskListTopComponent.class, "HINT_TasksAsList" ) //NOI18N
: NbBundle.getMessage( TaskListTopComponent.class, "HINT_GrouppedTasks" ) ); //NOI18N
}
});
toggleGroups.setSelected( Settings.getDefault().getGroupTasksByCategory() );
toggleGroups.setToolTipText( toggleGroups.isSelected()
? NbBundle.getMessage( TaskListTopComponent.class, "HINT_TasksAsList" ) //NOI18N
: NbBundle.getMessage( TaskListTopComponent.class, "HINT_GrouppedTasks" ) ); //NOI18N
toggleGroups.setFocusable( false );
toolbar.add( toggleGroups );
}
示例3: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
protected ImageIcon getIcon() {
if (ICON == null) {
ICON = ImageUtilities.loadImageIcon(ICON_RESOURCE, false);
}
return ICON;
}
示例4: createScrollLeftButton
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
/**
* Button to scroll tabs left/up. The button sets up a timer when pressed
* to call the scroll action repeatedly until released or until the action
* becomes disabled.
* @param scrollAction Action implementing the actual scrolling.
* @return Button to scroll left/up.
*/
public static JButton createScrollLeftButton( Action scrollAction ) {
JButton btn = new TimerButton( scrollAction );
Icon icon = ImageUtilities.loadImageIcon( "org/netbeans/core/multitabs/resources/left.png", true); //NOI18N
btn.setIcon( icon );
btn.setToolTipText( NbBundle.getMessage(ButtonFactory.class, "Hint_ScrollLeft") );
return btn;
}
示例5: getBaseIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
protected ImageIcon getBaseIcon() {
if (icon == null) {
icon = ImageUtilities.loadImageIcon(CLASS, false);
}
return icon;
}
示例6: toIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
static Icon toIcon( ResizeOption.Type type ) {
switch( type ) {
case NETBOOK: return ImageUtilities.loadImageIcon( ICON_PATH_PREFIX+"netbook.png", true ); //NOI18N
case SMARTPHONE_LANDSCAPE: return ImageUtilities.loadImageIcon( ICON_PATH_PREFIX+"handheldLandscape.png", true ); //NOI18N
case SMARTPHONE_PORTRAIT: return ImageUtilities.loadImageIcon( ICON_PATH_PREFIX+"handheldPortrait.png", true ); //NOI18N
case TABLET_LANDSCAPE: return ImageUtilities.loadImageIcon( ICON_PATH_PREFIX+"tabletLandscape.png", true ); //NOI18N
case TABLET_PORTRAIT: return ImageUtilities.loadImageIcon( ICON_PATH_PREFIX+"tabletPortrait.png", true ); //NOI18N
case WIDESCREEN: return ImageUtilities.loadImageIcon( ICON_PATH_PREFIX+"widescreen.png", true ); //NOI18N
}
return ImageUtilities.loadImageIcon( ICON_PATH_PREFIX+"desktop.png", true ); //NOI18N
}
示例7: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
protected ImageIcon getIcon(){
if (icon == null) {
icon = ImageUtilities.loadImageIcon(PACKAGE, false);
}
return icon;
}
示例8: prepareSearchPanel
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
private void prepareSearchPanel() {
if( searchpanel == null ) {
searchpanel = new SearchPanel();
JLabel lbl = new JLabel(NbBundle.getMessage(PalettePanel.class, "LBL_QUICKSEARCH")); //NOI18N
searchpanel.setLayout(new GridBagLayout());
searchpanel.add(lbl, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,5), 0, 0));
searchpanel.add(searchTextField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,5), 0, 0));
searchpanel.add(new JLabel(), new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,0), 0, 0));
lbl.setLabelFor(searchTextField);
searchTextField.setColumns(10);
searchTextField.setMaximumSize(searchTextField.getPreferredSize());
searchTextField.putClientProperty("JTextField.variant", "search"); //NOI18N
lbl.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
JButton btnCancel = new JButton(ImageUtilities.loadImageIcon("org/netbeans/modules/palette/resources/cancel.png", true));
btnCancel.setBorder(BorderFactory.createEmptyBorder());
btnCancel.setBorderPainted(false);
btnCancel.setOpaque(false);
btnCancel.setContentAreaFilled(false);
searchpanel.add(btnCancel, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0,0,0,5), 0, 0));
btnCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
removeSearchField();
}
});
}
}
示例9: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
protected ImageIcon getIcon() {
if (insertText.endsWith("/")) { // NOI18N
return ImageUtilities.loadImageIcon(ICON_FOLDER, false);
} else if (fileResource != null) {
return ImageUtilities.loadImageIcon(fileResource, true);
} else if (icon != null) {
return icon;
} else {
Path p = basePath.resolve(insertText);
if (p != null) {
FileObject f = FileUtil.toFileObject(p.toFile());
if (f != null) {
Node n;
try {
DataObject d = DataObject.find(f);
n = d.getNodeDelegate();
} catch (DataObjectNotFoundException ex) {
n = f.getLookup().lookup(Node.class);
}
if (n != null) {
return (ImageIcon)ImageUtilities.image2Icon(n.getIcon(BeanInfo.ICON_COLOR_16x16));
}
}
}
return icon = ImageUtilities.loadImageIcon(ICON_FILE, false);
}
}
示例10: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override
protected ImageIcon getIcon() {
return ImageUtilities.loadImageIcon(CLASS, false);
}
示例11: OptionsAction
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Messages("LBL_OptionsAction=Maven Settings")
public OptionsAction() {
super(LBL_OptionsAction(), ImageUtilities.loadImageIcon("org/netbeans/modules/maven/execute/options.png", true));
putValue(Action.SHORT_DESCRIPTION, LBL_OptionsAction());
}
示例12: getIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
@Override public Icon getIcon() {
return ImageUtilities.loadImageIcon("org/netbeans/modules/maven/osgi/maven_osgi_16.png", true);
}
示例13: RemoteTerminalAction
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
public RemoteTerminalAction() {
super("RemoteTerminalAction", NbBundle.getMessage(RemoteTerminalAction.class, "RemoteTerminalShortDescr"), // NOI18N
ImageUtilities.loadImageIcon("org/netbeans/modules/dlight/terminal/action/remote_term.png", false)); // NOI18N
cfgPanel = new RemoteInfoDialog(System.getProperty("user.name"));
}
示例14: getLocaleIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
/** Utility method. Gets icon for key item in key list. */
private static Icon getLocaleIcon() {
return ImageUtilities.loadImageIcon("org/netbeans/modules/properties/propertiesLocale.gif", false); // NOI18N
}
示例15: getDbIcon
import org.openide.util.ImageUtilities; //导入方法依赖的package包/类
private Icon getDbIcon() {
return ImageUtilities.loadImageIcon(
"org/netbeans/modules/derby/resources/database.gif", //NOI18N
false);
}