|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel net.lucidviews.util.gui.swing.JWebAddress
public class JWebAddress
A label and text-field composite for entering a web address.
Nested Class Summary | |
---|---|
static class |
JWebAddress.WebAddressActionEvent
An ActionEvent specific to the JWebAddress
component. |
static class |
JWebAddress.WebAddressDropTarget
A DropTarget that accepts addresses dropped onto the input
field. |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected URL |
currentAddress
The last confirmed address. |
private static String |
DEFAULT_LABEL
The default label, used when none is specified. |
private static Border |
DEFAULT_LABEL_BORDER
The default border for the label. |
protected JTextField |
inputField
The input field into which the user types the web address. |
protected JLabel |
label
The label that prompts the user to enter a web address. |
protected Collection<ActionListener> |
listeners
Registered listeners, waiting for notification of a change of address. |
private static long |
serialVersionUID
Serialisation version id. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JWebAddress(String toolTipText)
Create a component for the input of a web address. |
|
JWebAddress(String toolTipText,
Border labelBorder)
Create a component for the input of a web address. |
|
JWebAddress(String toolTipText,
String label)
Create a component for the input of a web address. |
|
JWebAddress(String toolTipText,
String label,
Border labelBorder)
Create a component for the input of a web address. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
void |
addActionListener(ActionListener listener)
Register a listener that wants to be notified of interactions with the web address. |
void |
focusGained(FocusEvent e)
|
void |
focusLost(FocusEvent e)
|
URL |
getAddress()
Get the current address. |
void |
go()
Go to the location that has been entered into this web address component. |
void |
go(int modifiers)
Go to the location that has been entered into this web address component. |
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
void |
keyTyped(KeyEvent e)
|
void |
removeActionListener(ActionListener listener)
Un-register a listener that does not want to be notified of interactions with the web address. |
void |
resetAddress()
Reset the text displayed to the last confirmed URL (confirmed by a call to setAddress . |
void |
resetAddress(URL address)
Confirm the URL being used. |
void |
setAddress(String address)
Set the web address. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final String DEFAULT_LABEL
private static final Border DEFAULT_LABEL_BORDER
protected Collection<ActionListener> listeners
protected URL currentAddress
inputField
protected JLabel label
protected JTextField inputField
currentAddress
Constructor Detail |
---|
public JWebAddress(String toolTipText)
toolTipText
- text to display when user hovers their pointer over the web addresspublic JWebAddress(String toolTipText, String label)
toolTipText
- text to display when user hovers their pointer over the web addresslabel
- text to display beside the input box, it should describe what to enter into the address barpublic JWebAddress(String toolTipText, Border labelBorder)
toolTipText
- text to display when user hovers their pointer over the web addresslabelBorder
- border applied around the labelpublic JWebAddress(String toolTipText, String label, Border labelBorder)
toolTipText
- text to display when user hovers their pointer over the web addresslabel
- text to display beside the input box, it should describe what to enter into the address barlabelBorder
- border applied around the labelMethod Detail |
---|
public void addActionListener(ActionListener listener)
listener
- object that is to receive notificationspublic void removeActionListener(ActionListener listener)
listener
- object that is no longer to receive notificationspublic URL getAddress()
public void resetAddress()
setAddress
.
public void resetAddress(URL address)
WebAddressActionEvent
to
confirm that the URL entered by the user is valid and is being used.
address
- the URL of the file that is now being usedpublic void setAddress(String address)
go
method.
address
- the web addressgo()
public void go()
public void go(int modifiers)
modifiers
- the modifier keys (Alt, Ctrl, etc)
that were pressed when the command to 'go' was receivedpublic void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void focusGained(FocusEvent e)
focusGained
in interface FocusListener
public void focusLost(FocusEvent e)
focusLost
in interface FocusListener
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |