/hg/icedtea-web: 2 new changesets
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Tue Mar 11 17:29:56 UTC 2014
changeset 7467c864c3c2 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=7467c864c3c2
author: Jiri Vanek <jvanek at redhat.com>
date: Tue Mar 11 18:30:34 2014 +0100
Added clean button for Java Console
changeset 4d2b8cbf5259 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=4d2b8cbf5259
author: Jiri Vanek <jvanek at redhat.com>
date: Tue Mar 11 18:37:55 2014 +0100
New java console made localizable
diffstat:
ChangeLog | 19 +
netx/net/sourceforge/jnlp/resources/Messages.properties | 44 ++++
netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java | 110 +++++----
netx/net/sourceforge/jnlp/util/logging/JavaConsole.java | 30 ++-
4 files changed, 149 insertions(+), 54 deletions(-)
diffs (433 lines):
diff -r f0ffdf45c4dc -r 4d2b8cbf5259 ChangeLog
--- a/ChangeLog Tue Mar 11 12:26:10 2014 +0100
+++ b/ChangeLog Tue Mar 11 18:37:55 2014 +0100
@@ -1,3 +1,22 @@
+2014-03-11 Jiri Vanek <jvanek at redhat.com>
+
+ New java console made localizable.
+ *netx/net/sourceforge/jnlp/resources/Messages.properties: added new family of
+ keys (COP) for new console
+ *netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: where reasonable,
+ strings replaced by records in properties.
+ * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: (rawData) and
+ (outputs) made final.
+
+2014-03-11 Jiri Vanek <jvanek at redhat.com>
+
+ * netx/net/sourceforge/jnlp/resources/Messages.properties: added (CONSOLEClean)
+ key for new button
+ * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: (update)
+ method enhanced for possibility to force refresh
+ * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: added ButClean
+ button. (updateModel) overlaoded with force attribute.
+
2014-03-11 Jiri Vanek <jvanek at redhat.com>
* netx/policyeditor.1: Mentioned that it is more GUI then commandline tool
diff -r f0ffdf45c4dc -r 4d2b8cbf5259 netx/net/sourceforge/jnlp/resources/Messages.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Mar 11 12:26:10 2014 +0100
+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Mar 11 18:37:55 2014 +0100
@@ -551,6 +551,50 @@
CONSOLEmemoryMax = Max Memory
CONSOLEmemoryTotal = Total Memory
CONSOLEmemoryFree = Free Memory
+CONSOLEClean=Clean all
+
+#console output pane labels
+COPsortCopyAllDate=sort copy all by date
+COPshowHeaders=Show headers:
+COPuser=user
+COPorigin=origin
+COPlevel=level
+COPdate=date
+COPthread1=thread 1
+COPthread2=thread 2
+COPShowMessages=Show messages
+COPstdOut=std. Out
+COPstdErr=std. Err
+COPjava=java
+COPplugin=plugin
+COPpreInit=pre-init
+COPpluginOnly=plugin only
+COPSortBy=Sort by
+COPregex=Regular expression filter
+COPAsArrived=As arrived (no sort)
+COPcode=code
+COPmessage=message
+COPSearch=Search
+COPautoRefresh=auto refresh
+COPrefresh=refresh
+COPApply=Apply
+COPmark=mark
+COPCopyAllPlain=Copy all (plain)
+COPCopyAllRich=Copy all (rich)
+COPnext=next>>>
+COPprevious=<<<previous
+COPcaseSensitive=case sensitive
+COPincomplete=incomplete
+COPhighlight=highlight
+COPwordWrap=word wrap
+COPdebug=debug
+COPinfo=info
+COPcode=code
+COPpostInit=post-init
+COPcomplete=complete
+COPmatch=match
+COPnot=not
+COPrevert=revert
# Control Panel - DesktopShortcutPanel
DSPNeverCreate=Never create
diff -r f0ffdf45c4dc -r 4d2b8cbf5259 netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java
--- a/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java Tue Mar 11 12:26:10 2014 +0100
+++ b/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java Tue Mar 11 18:37:55 2014 +0100
@@ -27,12 +27,21 @@
import javax.swing.text.PlainDocument;
import javax.swing.text.html.HTMLDocument;
import net.sourceforge.jnlp.runtime.JNLPRuntime;
+import net.sourceforge.jnlp.runtime.Translator;
import net.sourceforge.jnlp.util.logging.headers.ObservableMessagesProvider;
public class ConsoleOutputPane extends javax.swing.JPanel implements Observer {
@Override
public synchronized void update(Observable o, Object arg) {
+ boolean force = false;
+ if ( arg!= null && arg instanceof Boolean && ((Boolean)arg).booleanValue()) {
+ force = true;
+ }
+ if (force){
+ refreshPane();
+ return;
+ }
if (!autorefresh.isSelected()) {
statistics.setText(model.createStatisticHint());
return;
@@ -288,79 +297,88 @@
showHide = new javax.swing.JButton();
sortCopyAll.setSelected(true);
- sortCopyAll.setText("sort copy all by date");
+ sortCopyAll.setText(Translator.R("COPsortCopyAllDate"));
sortCopyAll.setToolTipText("The sort by date is a bit more time consuming, but most natural for posting purposes");
showHeaders.setSelected(true);
- showHeaders.setText("Show headers:");
+ showHeaders.setText(Translator.R("COPshowHeaders"));
showHeaders.addActionListener(getDefaultActionSingleton());
showUser.setSelected(true);
- showUser.setText("user");
+ showUser.setText(Translator.R("COPuser"));
showUser.addActionListener(getDefaultActionSingleton());
showOrigin.setSelected(true);
- showOrigin.setText("origin");
+ showOrigin.setText(Translator.R("COPorigin"));
showOrigin.addActionListener(getDefaultActionSingleton());
showLevel.setSelected(true);
- showLevel.setText("level");
+ showLevel.setText(Translator.R("COPlevel"));
showLevel.addActionListener(getDefaultActionSingleton());
showDate.setSelected(true);
- showDate.setText("date");
+ showDate.setText(Translator.R("COPdate"));
showDate.addActionListener(getDefaultActionSingleton());
showThread1.setSelected(true);
- showThread1.setText("thread 1");
+ showThread1.setText(Translator.R("COPthread1"));
showThread1.addActionListener(getDefaultActionSingleton());
showThread2.setSelected(true);
- showThread2.setText("thread 2");
+ showThread2.setText(Translator.R("COPthread2"));
showThread2.addActionListener(getDefaultActionSingleton());
showMessage.setSelected(true);
- showMessage.setText("Show messages");
+ showMessage.setText(Translator.R("COPShowMessages"));
showMessage.addActionListener(getDefaultActionSingleton());
showOut.setSelected(true);
- showOut.setText("std. Out");
+ showOut.setText(Translator.R("COPstdOut"));
showOut.addActionListener(getDefaultActionSingleton());
showErr.setSelected(true);
- showErr.setText("std. Err");
+ showErr.setText(Translator.R("COPstdErr"));
showErr.addActionListener(getDefaultActionSingleton());
showJava.setSelected(true);
- showJava.setText("java");
+ showJava.setText(Translator.R("COPjava"));
showJava.addActionListener(getDefaultActionSingleton());
showPlugin.setSelected(true);
- showPlugin.setText("plugin");
+ showPlugin.setText(Translator.R("COPplugin"));
showPlugin.addActionListener(getDefaultActionSingleton());
showPreInit.setSelected(true);
- showPreInit.setText("pre-init");
- showPreInit.setToolTipText("plugin only");
+ showPreInit.setText(Translator.R("COPpreInit"));
+ showPreInit.setToolTipText(Translator.R("COPpluginOnly"));
showPreInit.addActionListener(getDefaultActionSingleton());
- sortByLabel.setText("Sort by:");
+ sortByLabel.setText(Translator.R("COPSortBy") + ":");
- regExLabel.setText("Regular expression filter:");
+ regExLabel.setText(Translator.R("COPregex") + ":");
regExLabel.addActionListener(getDefaultActionSingleton());
- sortBy.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"As arrived (no sort)", "user", "origin", "level", "date", "code", "thread1", "thread2", "message"}));
+ sortBy.setModel(new javax.swing.DefaultComboBoxModel(new String[]{
+ Translator.R("COPAsArrived"),
+ Translator.R("COPuser"),
+ Translator.R("COPorigin"),
+ Translator.R("COPlevel"),
+ Translator.R("COPdate"),
+ Translator.R("COPcode"),
+ Translator.R("COPthread1"),
+ Translator.R("COPthread2"),
+ Translator.R("COPmessage")}));
sortBy.addActionListener(getDefaultActionSingleton());
- searchLabel.setText("Search:");
+ searchLabel.setText(Translator.R("COPSearch") + ":");
autorefresh.setSelected(true);
- autorefresh.setText("auto refresh");
+ autorefresh.setText(Translator.R("COPautoRefresh"));
- refresh.setText("refresh");
+ refresh.setText(Translator.R("COPrefresh"));
refresh.addActionListener(getDefaultActionSingleton());
- apply.setText("Apply");
+ apply.setText(Translator.R("COPApply"));
apply.addActionListener(new java.awt.event.ActionListener() {
@Override
@@ -372,7 +390,7 @@
regExFilter.setText(".*");
- copyPlain.setText("Copy all (plain)");
+ copyPlain.setText(Translator.R("COPCopyAllPlain"));
copyPlain.addActionListener(new java.awt.event.ActionListener() {
@Override
@@ -381,7 +399,7 @@
}
});
- copyRich.setText("Copy all (rich)");
+ copyRich.setText(Translator.R("COPCopyAllRich"));
copyRich.addActionListener(new java.awt.event.ActionListener() {
@Override
@@ -390,7 +408,7 @@
}
});
- next.setText("next>>>");
+ next.setText(Translator.R("COPnext"));
next.addActionListener(new java.awt.event.ActionListener() {
@Override
@@ -399,7 +417,7 @@
}
});
- previous.setText("<<<previous");
+ previous.setText(Translator.R("COPprevious"));
previous.addActionListener(new java.awt.event.ActionListener() {
@Override
@@ -408,56 +426,56 @@
}
});
- caseSensitive.setText("case sensitive");
+ caseSensitive.setText(Translator.R("COPcaseSensitive"));
showIncomplete.setSelected(true);
- showIncomplete.setText("incomplete");
- showIncomplete.setToolTipText("plugin only");
+ showIncomplete.setText(Translator.R("COPincomplete"));
+ showIncomplete.setToolTipText(Translator.R("COPpluginOnly"));
showIncomplete.addActionListener(getDefaultActionSingleton());
highLight.setSelected(true);
- highLight.setText("highlight");
+ highLight.setText(Translator.R("COPhighlight"));
highLight.addActionListener(getDefaultActionSingleton());
- wordWrap.setText("word wrap");
+ wordWrap.setText(Translator.R("COPwordWrap"));
wordWrap.addActionListener(getDefaultActionSingleton());
showDebug.setSelected(true);
- showDebug.setText("debug");
+ showDebug.setText(Translator.R("COPdebug"));
showDebug.addActionListener(getDefaultActionSingleton());
showInfo.setSelected(true);
- showInfo.setText("info");
+ showInfo.setText(Translator.R("COPinfo"));
showInfo.addActionListener(getDefaultActionSingleton());
showCode.setSelected(true);
- showCode.setText("code");
+ showCode.setText(Translator.R("COPcode"));
showCode.addActionListener(getDefaultActionSingleton());
statistics.setText("x/y");
showPostInit.setSelected(true);
- showPostInit.setText("post-init");
- showPostInit.setToolTipText("plugin only");
+ showPostInit.setText(Translator.R("COPpostInit"));
+ showPostInit.setToolTipText(Translator.R("COPpluginOnly"));
showPostInit.addActionListener(getDefaultActionSingleton());
showComplete.setSelected(true);
- showComplete.setText("complete");
- showComplete.setToolTipText("plugin only");
+ showComplete.setText(Translator.R("COPcomplete"));
+ showComplete.setToolTipText(Translator.R("COPpluginOnly"));
showComplete.addActionListener(getDefaultActionSingleton());
match.setSelected(true);
- match.setText("match");
+ match.setText(Translator.R("COPmatch"));
match.addActionListener(getDefaultActionSingleton());
- notMatch.setText("not");
+ notMatch.setText(Translator.R("COPnot"));
notMatch.addActionListener(getDefaultActionSingleton());
revertSort.setSelected(true);
- revertSort.setText("revert");
+ revertSort.setText(Translator.R("COPrevert"));
revertSort.addActionListener(getDefaultActionSingleton());
- mark.setText("mark");
+ mark.setText(Translator.R("COPmark"));
mark.addActionListener(new java.awt.event.ActionListener() {
@Override
@@ -586,7 +604,7 @@
jEditorPane1.setEditable(false);
jScrollPane1.setViewportView(jEditorPane1);
- showHide.setText("Hide");
+ showHide.setText(Translator.R("ButHideDetails"));
showHide.addActionListener(new java.awt.event.ActionListener() {
@Override
@@ -718,7 +736,7 @@
highlightPainter);
}
}
- mark.setText("mark (" + matches + ")");
+ mark.setText(Translator.R("COPmark") + "(" + matches + ")");
} catch (BadLocationException ex) {
OutputController.getLogger().log(ex);
}
@@ -781,10 +799,10 @@
private void showHideActionPerformed(java.awt.event.ActionEvent evt) {
if (jPanel2.isVisible()) {
jPanel2.setVisible(false);
- showHide.setText("Show controls");
+ showHide.setText(Translator.R("ButShowDetails"));
} else {
jPanel2.setVisible(true);
- showHide.setText("Hide");
+ showHide.setText(Translator.R("ButHideDetails"));
}
}
diff -r f0ffdf45c4dc -r 4d2b8cbf5259 netx/net/sourceforge/jnlp/util/logging/JavaConsole.java
--- a/netx/net/sourceforge/jnlp/util/logging/JavaConsole.java Tue Mar 11 12:26:10 2014 +0100
+++ b/netx/net/sourceforge/jnlp/util/logging/JavaConsole.java Tue Mar 11 18:37:55 2014 +0100
@@ -76,8 +76,6 @@
import net.sourceforge.jnlp.config.DeploymentConfiguration;
import net.sourceforge.jnlp.runtime.JNLPRuntime;
import net.sourceforge.jnlp.util.ImageResources;
-import net.sourceforge.jnlp.util.logging.headers.Header;
-import net.sourceforge.jnlp.util.logging.headers.JavaMessage;
import net.sourceforge.jnlp.util.logging.headers.MessageWithHeader;
import net.sourceforge.jnlp.util.logging.headers.ObservableMessagesProvider;
import net.sourceforge.jnlp.util.logging.headers.PluginMessage;
@@ -88,8 +86,8 @@
*/
public class JavaConsole implements ObservableMessagesProvider {
- private List<MessageWithHeader> rawData = Collections.synchronizedList(new ArrayList<MessageWithHeader>());
- private List<ConsoleOutputPane> outputs = new ArrayList<ConsoleOutputPane>();
+ final private List<MessageWithHeader> rawData = Collections.synchronizedList(new ArrayList<MessageWithHeader>());
+ final private List<ConsoleOutputPane> outputs = new ArrayList<ConsoleOutputPane>();
private void refreshOutputs() {
refreshOutputs(outputsPanel, (Integer)numberOfOutputs.getValue());
@@ -354,6 +352,19 @@
}
});
+ JButton cleanButton = new JButton(R("CONSOLEClean"));
+ buttonPanel.add(cleanButton);
+ cleanButton.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ synchronized (rawData){
+ rawData.clear();
+ updateModel(true);
+ }
+ }
+ });
+
initialized = true;
}
@@ -463,7 +474,7 @@
public static void main(String[] args) {
- final JavaConsole console = new JavaConsole();
+ final JavaConsole cconsole = new JavaConsole();
boolean toShowConsole = true;
@@ -474,7 +485,7 @@
}
if (toShowConsole) {
- console.showConsoleLater();
+ cconsole.showConsoleLater();
}
}
@@ -484,10 +495,13 @@
rawData.add(m);
updateModel();
}
-
+
private synchronized void updateModel() {
+ updateModel(null);
+ }
+ private synchronized void updateModel(Boolean force) {
observable.setChanged();
- observable.notifyObservers();
+ observable.notifyObservers(force);
}
More information about the distro-pkg-dev
mailing list