projects
/
jkeytool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make I18n class non-static.
[jkeytool.git]
/
src
/
net
/
pterodactylus
/
util
/
i18n
/
gui
/
I18nLabel.java
diff --git
a/src/net/pterodactylus/util/i18n/gui/I18nLabel.java
b/src/net/pterodactylus/util/i18n/gui/I18nLabel.java
index
32ad57d
..
a42e626
100644
(file)
--- a/
src/net/pterodactylus/util/i18n/gui/I18nLabel.java
+++ b/
src/net/pterodactylus/util/i18n/gui/I18nLabel.java
@@
-28,7
+28,7
@@
import net.pterodactylus.util.i18n.I18nable;
/**
* Label that can update itself from {@link I18n}.
/**
* Label that can update itself from {@link I18n}.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
public class I18nLabel extends JLabel implements I18nable {
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
public class I18nLabel extends JLabel implements I18nable {
@@
-41,18
+41,22
@@
public class I18nLabel extends JLabel implements I18nable {
/**
* Creates a new label with the given I18n basename.
/**
* Creates a new label with the given I18n basename.
- *
+ *
+ * @param i18n
+ * The I18n container
* @param i18nBasename
* The I18n basename of the label
*/
* @param i18nBasename
* The I18n basename of the label
*/
- public I18nLabel(String i18nBasename) {
- this(i18nBasename, (Component) null);
+ public I18nLabel(
I18n i18n,
String i18nBasename) {
+ this(i18n
, i18n
Basename, (Component) null);
}
/**
* Creates a new label with the given I18n basename that optionally is a
* label for the given component.
}
/**
* Creates a new label with the given I18n basename that optionally is a
* label for the given component.
- *
+ *
+ * @param i18n
+ * The I18n container
* @param i18nBasename
* The I18n basename of the label
* @param component
* @param i18nBasename
* The I18n basename of the label
* @param component
@@
-60,28
+64,32
@@
public class I18nLabel extends JLabel implements I18nable {
* <code>null</code> if this label should not activate a
* component
*/
* <code>null</code> if this label should not activate a
* component
*/
- public I18nLabel(String i18nBasename, Component component) {
- this(i18nBasename, component, (Object[]) null);
+ public I18nLabel(
I18n i18n,
String i18nBasename, Component component) {
+ this(i18n
, i18n
Basename, component, (Object[]) null);
}
/**
* Creates a new label with the given I18n basename that optionally is a
* label for the given component.
}
/**
* Creates a new label with the given I18n basename that optionally is a
* label for the given component.
- *
+ *
+ * @param i18n
+ * The I18n container
* @param i18nBasename
* The I18n basename of the label
* @param arguments
* Optional arguments that are handed in to
* {@link I18n#get(String, Object...)}
*/
* @param i18nBasename
* The I18n basename of the label
* @param arguments
* Optional arguments that are handed in to
* {@link I18n#get(String, Object...)}
*/
- public I18nLabel(String i18nBasename, Object... arguments) {
- this(i18nBasename, null, arguments);
+ public I18nLabel(
I18n i18n,
String i18nBasename, Object... arguments) {
+ this(i18n
, i18n
Basename, null, arguments);
}
/**
* Creates a new label with the given I18n basename that optionally is a
* label for the given component.
}
/**
* Creates a new label with the given I18n basename that optionally is a
* label for the given component.
- *
+ *
+ * @param i18n
+ * The I18n container
* @param i18nBasename
* The I18n basename of the label
* @param component
* @param i18nBasename
* The I18n basename of the label
* @param component
@@
-92,23
+100,23
@@
public class I18nLabel extends JLabel implements I18nable {
* Optional arguments that are handed in to
* {@link I18n#get(String, Object...)}
*/
* Optional arguments that are handed in to
* {@link I18n#get(String, Object...)}
*/
- public I18nLabel(String i18nBasename, Component component, Object... arguments) {
+ public I18nLabel(
I18n i18n,
String i18nBasename, Component component, Object... arguments) {
super();
this.i18nBasename = i18nBasename;
this.arguments = arguments;
if (component != null) {
setLabelFor(component);
}
super();
this.i18nBasename = i18nBasename;
this.arguments = arguments;
if (component != null) {
setLabelFor(component);
}
- updateI18n();
+ updateI18n(
i18n
);
}
/**
* {@inheritDoc}
*/
}
/**
* {@inheritDoc}
*/
- public void updateI18n() {
- setText(
I
18n.get(i18nBasename + ".name", arguments));
+ public void updateI18n(
I18n i18n
) {
+ setText(
i
18n.get(i18nBasename + ".name", arguments));
if (getLabelFor() != null) {
if (getLabelFor() != null) {
- setDisplayedMnemonic(
I
18n.getKey(i18nBasename + ".mnemonic"));
+ setDisplayedMnemonic(
i
18n.getKey(i18nBasename + ".mnemonic"));
}
}
}
}