本文整理匯總了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);
}