Skip to content

de AutoComplete

homebeaver edited this page May 10, 2022 · 4 revisions

AutoComplete

AutoComplete ist eine Klassengruppe im autocomplete package (functionality for text components and combo boxes).

package org.jdesktop.swingx.autocomplete;

import ...

final class AutoComplete {

    static class InputMap extends javax.swing.InputMap ...
    static class FocusAdapter extends java.awt.event.FocusAdapter ...
    static class KeyAdapter extends java.awt.event.KeyAdapter ...
    static class PropertyChangeListener implements java.beans.PropertyChangeListener ...
    static class SelectionAction implements Action ...

Static classes are basically a way of grouping classes together in Java. Java doesn't allow you to create top-level static classes; only nested (inner) static classes.

Das AutoComplete-Feature hat zwei Auspägungen

  • strict
  • non-strict

Das Beispiel zeigt eine JComboBox mit Vornamen. Der Nutzer tippt 'J','O','R' and 'G'... Nach jedem Buchstaben wird die mögliche Eingabe angezeigt. Bei "strict" werden nur die Vorgaben akzeptiert:

AutoCompleteDemo zeigt beide Feature Auspägungen indem AutoCompleteDecorator.decorate benutzt wird:

...
    private JComboBox<String> strictComboBox, nonStrictComboBox;
...    
        strictComboBox = new JComboBox<String>();
        nonStrictComboBox = new JComboBox<String>();
...        
        strictComboBox.setModel(new ListComboBoxModel<String>(names));
        nonStrictComboBox.setModel(new ListComboBoxModel<String>(names));
...        
        AutoCompleteDecorator.decorate(strictComboBox);
        
        nonStrictComboBox.setEditable(true); // damit wir non-strict eingeschaltet
        AutoCompleteDecorator.decorate(nonStrictComboBox);

Glossar

A

Algorithmus : eine Sammlung von Algorithmen in java, von Euklid bis RSA

AutoComplete : package bzw. class zur Autovervollständigung in Text Komponenten

B

Batik : Subprojekt von Apache XML Graphics Project

BSAF : Better Swing Application Framework

BuddySupport : erweitert Textkomponenten

C

Color : Farben im Farbkreis, Farbraum

Collection views : zu den SwingX collection views gehören JXList, JXTree, JXTable und JXTreeTable

ComboBox : allgemein (Wikipedia)

D

Data Transfer : wird im Java Kontext zusammen mit Cut&Paste und Drag and Drop verwendet

Demos : Demos-doku, github repo: SwingSet3-demos

dependences : projects in SwingSet3

DnD : steht für Drag and Drop

E

EDT : Event Dispatch Thread

F

G

GPX : GPS Exchange Format - ein XML-Datenformat mit Geo-Ortspunkten, -Routen und -Tracks

GUI : Graphical User Interface, Benutzeroberfläche, allgemein, siehe auch L&F (Look&Feel)

GVT : Batik Graphics Vector Tree (GVT) gehört zu Apache XML Graphics Project

H

I

J

JDNC : Java Desktop Network Component, s. BSAF

JPMS : Java Platform Module System, aka Modulsystem Jigsaw

JTextComponent, JTextField, JTextArea : siehe Prompt- und BuddySupport

K

Kenai : History of SwingLabs

L

L&F : als Look&Feel wird das Aussehen und Verhalten der Benutzeroberfäche bezeichnet.

LazyValue : TODO siehe MetalButtonPainterIssues

List, JList, JXList : Listen von Werten darstellen List, JList, JXList

M

maven central : Central OSSRH

N

Nimbus : Mit Java 1.6 wurde das cross-platform Look-and-Feel eingeführt. Es wird per properties konfiguriert, siehe Nimbus-UI-defaults

O

OSSRH : Open Source Software Repository Hosting, zentrales öffentliches Repository für Artefakte: Central-OSSRH

P

PLAF : steht für Pluggable Look And Feel

PromptSupport : erweitert Textkomponenten

public key server : siehe distributing-your-public-key

Q

R

Renderer : die Darstellung von mehr oder weniger komplexen Objekten auf der Benutzeroberfäche im gewählten Look&Feel

S

SAM : Single Abstract Method interface, Beispiel StringValue

SVG : Scalable Vector Graphics, XML-Beschreibung von Vektorgrafiken

SwingLabs : History of SwingLabs

SwingSet2 : github repo: SwingSet2-demos

SwingSet3 : github repo: SwingSet3, SwingSet3-demos

SwingX : package org.jdesktop.swingx SwingX

Synth : Seit Java 1.5 gibt es das Synth-Look-and-Feel, dessen Erscheinungsbild in einer XML-Datei beschrieben wird, s. Nimbus

T

Table : JXTable (de) erweitert javax.swing.JTable

Tests : Tests (de)

TextComponent : siehe Prompt- und BuddySupport

Tree : JXTree (de) erweitert javax.swing.JTree

TreeTable : JXTreeTable (de) ist ein Zwitter mit Eigenschaften von Tree und Table

Trident : Trident animation library (de)

U

UI : User Interface, Benutzerschnittstelle, allgemein, siehe auch GUI, L&F (Look&Feel)

V

W

X

Y

Z

Clone this wiki locally