| java.lang.Object org.netbeans.modules.apisupport.project.ui.UIUtil
UIUtil | final public class UIUtil (Code) | | UI related utility methods for the module.
author: Martin Krauskopf |
Inner Class :abstract public static class DocumentAdapter implements DocumentListener | |
Inner Class :public static class LayerItemPresenter implements Comparable<LayerItemPresenter> | |
Method Summary | |
public static NbModuleProject | chooseSuiteComponent(Component parent, SuiteProject suite) | public static ComboBoxModel | createLayerPresenterComboModel(Project project, String sfsRoot) Calls in turn
UIUtil.createLayerPresenterComboModel(Project,String,Map) with
Collections.EMPTY_MAP as a third parameter. | public static ComboBoxModel | createLayerPresenterComboModel(Project project, String sfsRoot, Map<String, Object> excludeAttrs) Returns
ComboBoxModel containing
UIUtil.LayerItemPresenter s
wrapping all folders under the given sfsRoot . | public static JComboBox | createPackageComboBox(SourceGroup srcRoot) Create combobox containing packages from the given
SourceGroup . | public static ListCellRenderer | createProjectRenderer() Appropriately renders
Project s. | public static String | generateTextAreaContent(String[] relPaths) Returns a string suitable for text areas respresenting content of
CreatedModifiedFiles paths. | public static Dimension | getIconDimension(File icon) | public static String | getIconDimensionWarning(File icon, int expectedWidth, int expectedHeight) | public static JFileChooser | getIconFileChooser() Returns an instance of
javax.swing.JFileChooser permitting
selection only a regular icon. | public static JFileChooser | getIconFileChooser(String oldValue) tries to set the selected file according to currently existing data. | public static String | getNoIconSelectedWarning(int expectedWidth, int expectedHeight) | public static String | getSFSPath(JComboBox lpCombo, String supposedRoot) Returns path relative to the root of the SFS. | public static Image | getTreeFolderIcon(boolean opened) Returns default folder icon as
java.awt.Image . | public static boolean | isValidIcon(File icon, int expectedWidth, int expectedHeight) | public static boolean | isValidPackageName(String str) Returns true for valid package name. | public static String | keyStrokeToString(KeyStroke keyStroke) | public static String | keyStrokesToLogicalString(KeyStroke[] keyStrokes) | public static String | keyStrokesToString(KeyStroke[] keyStrokes) | public static String | keyToLogicalString(KeyStroke keyStroke) | public static NbModuleProject | runLibraryWrapperWizard(Project suiteProvider) | public static NbModuleProject | runProjectWizard(NewNbModuleWizardIterator iterator, String titleBundleKey) | public static void | setProjectChooserDir(File folder) Calls in turn
ProjectChooser.setProjectsFolder if the
folder is not null and is a directory. | public static void | setProjectChooserDirParent(File fileOrFolder) Calls
UIUtil.setProjectChooserDir with the fileOrFolder 's
parent if it isn't null . | public static void | setText(JTextComponent textComp, String text) Set the text for the textComp and set its
caret position to the end of the text. | public static boolean | showAcceptCancelDialog(String title, String message, String acceptButton, String cancelButton, int messageType) Show an OK/cancel-type dialog with customized button texts. | public static boolean | showAcceptCancelDialog(String title, String message, String acceptButton, String accDescrAcceptButton, String cancelButton, int messageType) Show an OK/cancel-type dialog with customized button texts. | public static KeyStroke | stringToKeyStroke(String keyStroke) | public static KeyStroke[] | stringToKeyStrokes(String keyStrokes) Returns multi keystroke for given text representation of shortcuts
(like Alt+A B). |
createLayerPresenterComboModel | public static ComboBoxModel createLayerPresenterComboModel(Project project, String sfsRoot, Map<String, Object> excludeAttrs)(Code) | | Returns
ComboBoxModel containing
UIUtil.LayerItemPresenter s
wrapping all folders under the given sfsRoot .
Parameters: excludeAttrs - Map of pairs String - Object used to filterout folders which have one or more attribute(key)with a corresponding value. |
createPackageComboBox | public static JComboBox createPackageComboBox(SourceGroup srcRoot)(Code) | | Create combobox containing packages from the given
SourceGroup .
|
createProjectRenderer | public static ListCellRenderer createProjectRenderer()(Code) | | Appropriately renders
Project s. For others instances delegates
to
DefaultListCellRenderer .
|
generateTextAreaContent | public static String generateTextAreaContent(String[] relPaths)(Code) | | Returns a string suitable for text areas respresenting content of
CreatedModifiedFiles paths.
Parameters: relPaths - should be eitherCreatedModifiedFiles.getCreatedPaths orCreatedModifiedFiles.getModifiedPaths. |
getIconDimensionWarning | public static String getIconDimensionWarning(File icon, int expectedWidth, int expectedHeight)(Code) | | Parameters: icon - file representing icon Parameters: expectedWidth - expected width Parameters: expectedHeight - expected height warning or empty String |
getIconFileChooser | public static JFileChooser getIconFileChooser(String oldValue)(Code) | | tries to set the selected file according to currently existing data.
Will se it only if the String represents a file path that exists.
|
getNoIconSelectedWarning | public static String getNoIconSelectedWarning(int expectedWidth, int expectedHeight)(Code) | | Parameters: expectedWidth - expected width Parameters: expectedHeight - expected height warning |
getTreeFolderIcon | public static Image getTreeFolderIcon(boolean opened)(Code) | | Returns default folder icon as
java.awt.Image . Never returns
null .
Parameters: opened - wheter closed or opened icon should be returned. |
isValidIcon | public static boolean isValidIcon(File icon, int expectedWidth, int expectedHeight)(Code) | | Parameters: icon - file representing icon Parameters: expectedWidth - expected width Parameters: expectedHeight - expected height true if icon corresponds to expected dimension |
isValidPackageName | public static boolean isValidPackageName(String str)(Code) | | Returns true for valid package name.
|
runLibraryWrapperWizard | public static NbModuleProject runLibraryWrapperWizard(Project suiteProvider)(Code) | | |
setProjectChooserDir | public static void setProjectChooserDir(File folder)(Code) | | Calls in turn
ProjectChooser.setProjectsFolder if the
folder is not null and is a directory.
|
setProjectChooserDirParent | public static void setProjectChooserDirParent(File fileOrFolder)(Code) | | Calls
UIUtil.setProjectChooserDir with the fileOrFolder 's
parent if it isn't null . Otherwise fallbacks to
fileOrFolder itself if it is a directory.
|
setText | public static void setText(JTextComponent textComp, String text)(Code) | | Set the text for the textComp and set its
caret position to the end of the text.
|
showAcceptCancelDialog | public static boolean showAcceptCancelDialog(String title, String message, String acceptButton, String cancelButton, int messageType)(Code) | | Show an OK/cancel-type dialog with customized button texts.
Only a separate method because it is otherwise cumbersome to replace
the OK button with a button that is set as the default.
Parameters: title - the dialog title Parameters: message - the body of the message (usually HTML text) Parameters: acceptButton - a label for the default accept button; should not use mnemonics Parameters: cancelButton - a label for the cancel button (or null for default); should not use mnemonics Parameters: messageType - NotifyDescriptor.WARNING_MESSAGE or similar true if user accepted the dialog |
showAcceptCancelDialog | public static boolean showAcceptCancelDialog(String title, String message, String acceptButton, String accDescrAcceptButton, String cancelButton, int messageType)(Code) | | Show an OK/cancel-type dialog with customized button texts.
Only a separate method because it is otherwise cumbersome to replace
the OK button with a button that is set as the default.
Parameters: title - the dialog title Parameters: message - the body of the message (usually HTML text) Parameters: acceptButton - a label for the default accept button; should not use mnemonics Parameters: accDescrAcceptButton - a accessible description for acceptButton Parameters: cancelButton - a label for the cancel button (or null for default); should not use mnemonics Parameters: messageType - NotifyDescriptor.WARNING_MESSAGE or similar true if user accepted the dialog |
stringToKeyStrokes | public static KeyStroke[] stringToKeyStrokes(String keyStrokes)(Code) | | Returns multi keystroke for given text representation of shortcuts
(like Alt+A B). Returns null if text is not parsable, and empty array
for empty string.
|
|
|