mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-29 01:37:51 +08:00
* Add UI Guidelines to SDK docs * Add UI Guidelines to SDK docs * Fixing build errors * optimize PNGs * add UI guidelines landing page placeholder * IJ SDK Docs <-> UI guidelines crosslinks updated * split_button.md: remove reference to removed setting * use <ui-path> * use MD instead of <note> * use %gh-ic% links * drop_down.md: fix <control> * code samples: fix most obvious issues * remove obsolete `_defaults.md` * ijs.tree: UI cleanup * Delete "under construction" pages * Fix headers * Add link-summary * Remove invalid links * Delete unused files * Remove ''@2x' from image file names * Use Markdown syntax for some images and tables * Rename non-unique files to unique * Remove alpha in images where content is unreadable * align quotation marks * Controls: cleanup/fixes, add code links, edit * tooltip.md: fix HTML * misc fixes * typography.md: fix table contents * typography.md: fix table header * UI guidelines landing page + TOC fixes * remove unused icons_list.md * Normalize image paths * validation_errors.md: Fix broken tab * "correct"/"incorrect" labels styling * Resize images to 50% * button.topic: fixes * grammar, spelling, minor edits * remove ' ' * fix 99px * cleanup * UI_kit.md: minor * Fix "MRK058: Large image in paragraph rendered as a block element by default." * button.topic: Add img[alt] * mnemonics.md: Update "Contact Us" link to the IJSDK YouTrack * split_button.md: Use ui-path * UI landing: add feedback snippet * Improve code snippets formatting and naming * Fix code samples * Fix code samples * Add Kotlin variants for code samples * Add icons_list.md * crosslinks * Change external link to https://intellij-icons.jetbrains.design/ * icons list -> https://intellij-icons.jetbrains.design * Hide info about reducing split button to simple action button (now it is available through the registry only) * reformat * icons_style.md: Images in new line --------- Co-authored-by: marianna.kononenko <marianna.kononenko@jetbrains.com> Co-authored-by: Yann Cébron <yann.cebron@jetbrains.com>
95 lines
1.9 KiB
Markdown
95 lines
1.9 KiB
Markdown
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
|
|
|
# Loader
|
|
|
|
<link-summary>UI guidelines on using loaders.</link-summary>
|
|
|
|
<tldr>
|
|
|
|
**Implementation:** [`AnimatedIcon.Default`](%gh-ic%/platform/ide-core/src/com/intellij/ui/AnimatedIcon.java)
|
|
|
|
</tldr>
|
|
|
|
A loader informs users about performing a lengthy operation.
|
|
|
|
{width=330}
|
|
|
|
## When to use
|
|
|
|
Follow the rules for [progress indicators](progress_indicators.md).
|
|
|
|
## How to use
|
|
|
|
The loader form and sizes are the same in all themes. Use the default 16x16 loader in all cases.
|
|
<tabs group="languages">
|
|
<tab title="Kotlin" group-key="kotlin">
|
|
|
|
```kotlin
|
|
JLabel(
|
|
"Loading...",
|
|
AnimatedIcon.Default(),
|
|
SwingConstants.LEFT
|
|
)
|
|
```
|
|
|
|
</tab>
|
|
<tab title="Java" group-key="java">
|
|
|
|
```java
|
|
new JLabel(
|
|
"Loading...",
|
|
new AnimatedIcon.Default(),
|
|
SwingConstants.LEFT
|
|
);
|
|
```
|
|
|
|
</tab>
|
|
</tabs>
|
|
|
|
|
|
|
|
A loader may have a label if the process is long and the loader is shown in an empty area. In this case, use a [progress text](progress_text.md) as the label:
|
|
|
|
{width=597}
|
|
|
|
Remove the loader as soon as the process completes.
|
|
|
|
## Placement
|
|
|
|
<table style="none">
|
|
|
|
<tr>
|
|
<td> Inside a field </td>
|
|
<td> <img src="placement_field.png" width="161"/> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td colspan="2">
|
|
<code-block lang="java">
|
|
ExpandableTextField textField = new ExpandableTextField();
|
|
textField.addExtension(
|
|
Extension.create(new AnimatedIcon.Default(), null, null)
|
|
);
|
|
</code-block>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>In a corner</td>
|
|
<td> <img src="placement_corner.png" width="32" />
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td> Next to an item </td>
|
|
<td> <img src="placement_item.png" width="55" /> </td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td> Before a progress text </td>
|
|
<td> <img src="placement_progress_text.png" width="110" />
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|