git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@4024 ebf7c1c2-ba36-0410-9fe8-c592906822b4

This commit is contained in:
Greeny 2008-12-08 22:59:23 +00:00
parent 0344dbc7b6
commit 3a1f067acd
4 changed files with 102 additions and 103 deletions

View File

@ -1,5 +1,5 @@
$translater$ = IrDA345 (ivan_345deepurple@hotmail.com)
$version$ = $Revision: 3848 $
$version$ = $Revision$
addons.jdgrowlnotification.menu.enable = Mensajes habilitados
addons.jdlowspeed.statusmessage.disabled = Deshabilitar detector de velocidad baja
addons.jdlowspeed.statusmessage.enabled = Habilitar detector de velocidad baja

View File

@ -1,3 +1,19 @@
// jDownloader - Downloadmanager
// Copyright (C) 2008 JD-Team jdownloader@freenet.de
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.gui.skins.simple;
import java.io.Serializable;
@ -10,45 +26,32 @@ import jd.config.SubConfiguration;
import jd.utils.JDUtilities;
public class JDLookAndFeelManager implements Serializable{
/**
*
*/
public class JDLookAndFeelManager implements Serializable {
private static final long serialVersionUID = -8056003135389551814L;
public static final String PARAM_PLAF = "PLAF";
private String ClassName;
private static boolean uiInitated = false;
private static SubConfiguration config = JDUtilities.getSubConfig(SimpleGUI.GUICONFIGNAME);
public String getClassName() {
return ClassName;
}
public void setClassName(String className) {
ClassName = className;
}
public JDLookAndFeelManager(String ClassName) {
this.ClassName = ClassName;
}
public JDLookAndFeelManager(LookAndFeelInfo lafi) {
this.ClassName = lafi.getClassName();
}
@Override
public String toString() {
// TODO Auto-generated method stub
return ClassName.substring(ClassName.lastIndexOf(".")+1, ClassName.length()-11);
private String className;
public static JDLookAndFeelManager[] getInstalledLookAndFeels() {
LookAndFeelInfo[] lafis = UIManager.getInstalledLookAndFeels();
JDLookAndFeelManager[] ret = new JDLookAndFeelManager[lafis.length];
for (int i = 0; i < lafis.length; i++) {
ret[i] = new JDLookAndFeelManager(lafis[i]);
}
return ret;
}
public static JDLookAndFeelManager getPlaf() {
Object plaf = config.getProperty(PARAM_PLAF, null);
if(plaf==null)
return new JDLookAndFeelManager(UIManager.getSystemLookAndFeelClassName());
if(plaf instanceof JDLookAndFeelManager)
if (plaf == null) return new JDLookAndFeelManager(UIManager.getSystemLookAndFeelClassName());
if (plaf instanceof JDLookAndFeelManager) {
return (JDLookAndFeelManager) plaf;
else if(plaf instanceof String)
{
} else if (plaf instanceof String) {
for (LookAndFeelInfo lafi : UIManager.getInstalledLookAndFeels()) {
if(lafi.getName().equals(plaf))
{
plaf=new JDLookAndFeelManager(lafi);
if (lafi.getName().equals(plaf)) {
plaf = new JDLookAndFeelManager(lafi);
config.setProperty(PARAM_PLAF, plaf);
config.save();
return (JDLookAndFeelManager) plaf;
@ -56,37 +59,48 @@ public class JDLookAndFeelManager implements Serializable{
}
}
return new JDLookAndFeelManager(UIManager.getSystemLookAndFeelClassName());
}
}
public static JDLookAndFeelManager[] getInstalledLookAndFeels() {
LookAndFeelInfo[] lafis = UIManager.getInstalledLookAndFeels();
JDLookAndFeelManager[] ret = new JDLookAndFeelManager[lafis.length];
for (int i = 0; i < lafis.length; i++) {
ret[i]=new JDLookAndFeelManager(lafis[i]);
}
return ret;
}
public static void setUIManager() {
if (uiInitated) { return; }
if (uiInitated) return;
uiInitated = true;
try {
UIManager.setLookAndFeel(getPlaf().ClassName);
UIManager.setLookAndFeel(getPlaf().getClassName());
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public JDLookAndFeelManager(LookAndFeelInfo lafi) {
this.className = lafi.getClassName();
}
public JDLookAndFeelManager(String className) {
this.className = className;
}
@Override
public boolean equals(Object obj) {
return (obj instanceof JDLookAndFeelManager) && ((JDLookAndFeelManager) obj).ClassName.equals(ClassName);
return (obj instanceof JDLookAndFeelManager) && ((JDLookAndFeelManager) obj).getClassName().equals(className);
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
@Override
public String toString() {
return className.substring(className.lastIndexOf(".") + 1, className.length() - 11);
}
}

View File

@ -933,16 +933,17 @@ public class LangFileEditor extends PluginOptional implements MouseListener {
}
private Vector<File> getSourceFiles(File directory) {
Vector<File> fileContents = new Vector<File>();
Vector<File> files = new Vector<File>();
for (File entry : directory.listFiles()) {
if (entry.isDirectory()) {
fileContents.addAll(getSourceFiles(entry));
} else if (entry.isFile()) {
if (JDIO.getFileExtension(entry).equals("java")) fileContents.add(entry);
for (File file : directory.listFiles()) {
if (file.isDirectory()) {
files.addAll(getSourceFiles(file));
} else if (file.getName().matches(".*\\.java$")) {
files.add(file);
}
}
return fileContents;
return files;
}
public void mouseClicked(MouseEvent e) {

View File

@ -10,9 +10,9 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class SourceParser {
private static String getLocalFile(File file) {
if (!file.exists())
return "";
if (!file.exists()) return "";
BufferedReader f;
try {
f = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
@ -29,55 +29,39 @@ public class SourceParser {
}
return "";
}
private static void parseAdditon(File file, String regexp) {
String text = getLocalFile(file);
text = text.replaceAll("(?is)/\\*.*?\\*/", "");
text = text.replaceAll("//.*", "");
text = text.replaceAll(".*final .*", ""); // kann man nich verändern
Matcher r = Pattern.compile(regexp).matcher(text);
if (r.find())
System.out.println(file);
// System.out.println(text);
}
private static Vector<File> getFiles(File file) {
Vector<File> ret = new Vector<File>();
try {
File[] list = file.listFiles();
for (File file2 : list) {
if (file2.isDirectory())
{
try {
Vector<File> ints = getFiles(file2);
for (File file3 : ints) {
ret.add(file3);
}
} catch (Exception e) {
// TODO: handle exception
}
}
else if (file2.getName().matches(".*\\.java$"))
ret.add(file2);
}
} catch (Exception e) {
// TODO: handle exception
}
return ret;
}
public static void parse(String regexp) {
Vector<File> ret = getFiles(new File("src"));
for (File file : ret) {
parseAdditon(file, regexp);
}
}
public static void main(String[] args) {
parse("system.update.error.message");
}
private static void parseAdditon(File file, String regexp) {
String text = getLocalFile(file);
text = text.replaceAll("(?is)/\\*.*?\\*/", "");
text = text.replaceAll("//.*", "");
text = text.replaceAll(".*final .*", ""); // kann man nich verändern
Matcher r = Pattern.compile(regexp).matcher(text);
if (r.find()) System.out.println(file);
}
private static Vector<File> getFiles(File directory) {
Vector<File> ret = new Vector<File>();
for (File file : directory.listFiles()) {
if (file.isDirectory()) {
ret.addAll(getFiles(file));
} else if (file.getName().matches(".*\\.java$")) {
ret.add(file);
}
}
return ret;
}
public static void parse(String regexp) {
for (File file : getFiles(new File("src"))) {
parseAdditon(file, regexp);
}
}
public static void main(String[] args) {
parse("system.update.error.message");
}
}