mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
[site] Swing components: cleanup
This commit is contained in:
parent
db1b5fade0
commit
079614fecd
@ -10,24 +10,43 @@ INITIAL_SOURCE https://confluence.jetbrains.com/display/IDEADEV/Miscellaneous+Sw
|
|||||||
|
|
||||||
### Messages
|
### Messages
|
||||||
|
|
||||||
The ```Messages``` class provides a way to show simple message boxes, input dialogs (modal dialogs with a text field) and chooser dialogs (modal dialogs with a combo box). The function of different methods of the class should be clear from their names. When running on Mac OS X, the message boxes shown by the Messages class use native UI.
|
The
|
||||||
|
[Messages](https://github.com/JetBrains/intellij-community/blob/master/platform/platform-api/src/com/intellij/openapi/ui/Messages.java)
|
||||||
|
class provides a way to show simple message boxes, input dialogs (modal dialogs with a text field) and chooser dialogs (modal dialogs with a combo box).
|
||||||
|
The function of different methods of the class should be clear from their names.
|
||||||
|
When running on Mac OS X, the message boxes shown by the
|
||||||
|
[Messages](https://github.com/JetBrains/intellij-community/blob/master/platform/platform-api/src/com/intellij/openapi/ui/Messages.java)
|
||||||
|
class use native UI.
|
||||||
|
|
||||||
The ```showCheckboxMessageDialog()``` function provides an easy way to implement a "do not show this again" checkbox on messages.
|
The ```showCheckboxMessageDialog()``` function provides an easy way to implement a ```Do not show this again``` checkbox on messages.
|
||||||
|
|
||||||
Note that it is recommended to use non-modal notifications instead of modal message boxes whenever it's appropriate.
|
Note that it is recommended to use non-modal notifications instead of modal message boxes whenever it's appropriate.
|
||||||
Please refer to the [Notifications](notifications.html) topic for more information.
|
Please refer to the [Notifications](notifications.html) topic for more information.
|
||||||
|
|
||||||
### JBSplitter
|
### JBSplitter
|
||||||
|
|
||||||
The ```JBSplitter``` class is JetBrains' replacement for the standard JSplitPane class.
|
The
|
||||||
|
[JBSplitter](https://github.com/JetBrains/intellij-community/blob/master/platform/platform-api/src/com/intellij/ui/JBSplitter.java)
|
||||||
|
class is JetBrains' replacement for the standard
|
||||||
|
[JSplitPane](http://docs.oracle.com/javase/8/docs/api/javax/swing/JSplitPane.html)
|
||||||
|
class.
|
||||||
Unlike some other JetBrains-enhanced Swing components, it's not a drop-in replacement and has a different API.
|
Unlike some other JetBrains-enhanced Swing components, it's not a drop-in replacement and has a different API.
|
||||||
However, to achieve a consistent user experience, it's recommended to use JBSplitter instead of the standard JSplitPane in your plugins.
|
However, to achieve a consistent user experience, it's recommended to use
|
||||||
|
[JBSplitter](https://github.com/JetBrains/intellij-community/blob/master/platform/platform-api/src/com/intellij/ui/JBSplitter.java)
|
||||||
|
instead of the standard
|
||||||
|
[JSplitPane](http://docs.oracle.com/javase/8/docs/api/javax/swing/JSplitPane.html)
|
||||||
|
in your plugins.
|
||||||
|
|
||||||
To add your components to the splitter, call the ```setFirstComponent``` and ```setSecondComponent``` methods.
|
To add your components to the splitter, call the ```setFirstComponent()``` and ```setSecondComponent()``` methods.
|
||||||
|
|
||||||
JBSplitter supports automatic remembering of the split proportion. In order to enable it, call the ```setSplitterProportionKey``` method and pass the ID under which the proportion will be stored.
|
[JBSplitter](https://github.com/JetBrains/intellij-community/blob/master/platform/platform-api/src/com/intellij/ui/JBSplitter.java)
|
||||||
|
supports automatic remembering of the split proportion.
|
||||||
|
In order to enable it, call the ```setSplitterProportionKey()``` method and pass the ID under which the proportion will be stored.
|
||||||
|
|
||||||
### JBTabs
|
### JBTabs
|
||||||
|
|
||||||
The ```JBTabs``` class is JetBrains' implementation of the tab control, used for editor tabs and a few other components. It has a significantly different look & feel compared to the standard Swing tabs, and looks less native on the Mac OS X platform, so it's up to you to choose which tab control would be more appropriate for your plugin.
|
The
|
||||||
|
[JBTabs](https://github.com/JetBrains/intellij-community/blob/master/platform/platform-api/src/com/intellij/ui/tabs/JBTabs.java)
|
||||||
|
class is JetBrains' implementation of the tab control, used for editor tabs and a few other components.
|
||||||
|
It has a significantly different look & feel compared to the standard Swing tabs, and looks less native on the Mac OS X platform, so it's up to you to choose which tab control would be more appropriate for your plugin.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user