Révision 3233
tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 3233) | ||
---|---|---|
117 | 117 |
* Query. |
118 | 118 |
*/ |
119 | 119 |
public static final String QUERY = "query"; //$NON-NLS-1$ |
120 |
|
|
121 |
/** |
|
122 |
* Query. |
|
123 |
*/ |
|
124 |
public static final String TARGET_STRATEGY = "target_strategy"; //$NON-NLS-1$ |
|
120 | 125 |
|
121 | 126 |
/** |
122 | 127 |
* Result index. |
... | ... | |
222 | 227 |
// End of command preferences shared strings |
223 | 228 |
|
224 | 229 |
public static final String PERSITABLE = "persistable"; |
230 |
|
|
225 | 231 |
|
226 | 232 |
/** |
227 | 233 |
* Preferences node qualifier of the instance. |
tmp/org.txm.core/src/java/org/txm/objects/Property.java (revision 3233) | ||
---|---|---|
1 |
// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.objects; |
|
29 |
|
|
30 |
import java.io.Serializable; |
|
31 |
|
|
32 |
import org.w3c.dom.Element; |
|
33 |
|
|
34 |
// TODO: Auto-generated Javadoc |
|
35 |
/** |
|
36 |
* The Class Property. |
|
37 |
*/ |
|
38 |
public class Property { |
|
39 |
|
|
40 |
/** The key. */ |
|
41 |
String key; |
|
42 |
|
|
43 |
/** The value. */ |
|
44 |
Serializable value; |
|
45 |
|
|
46 |
/** The type. */ |
|
47 |
String type; |
|
48 |
|
|
49 |
/** The self element. */ |
|
50 |
Element selfElement; |
|
51 |
|
|
52 |
/** |
|
53 |
* Instantiates a new property. |
|
54 |
* |
|
55 |
* @param key the key |
|
56 |
* @param value the value |
|
57 |
* @param type the type |
|
58 |
* @param self the self |
|
59 |
*/ |
|
60 |
public Property(String key, Serializable value, String type, Element self) { |
|
61 |
this.key = key; |
|
62 |
this.value = value; |
|
63 |
this.type = type; |
|
64 |
this.selfElement = self; |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* Gets the value. |
|
69 |
* |
|
70 |
* @return the value |
|
71 |
*/ |
|
72 |
public Serializable getValue() { |
|
73 |
return value; |
|
74 |
} |
|
75 |
|
|
76 |
/** |
|
77 |
* Gets the type. |
|
78 |
* |
|
79 |
* @return the type |
|
80 |
*/ |
|
81 |
public String getType() { |
|
82 |
return type; |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* Sets the value. |
|
87 |
* |
|
88 |
* @param value the new value |
|
89 |
*/ |
|
90 |
public void setValue(Serializable value) { |
|
91 |
this.value = value; |
|
92 |
selfElement.setTextContent(value.toString()); |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* Sets the type. |
|
97 |
* |
|
98 |
* @param type the new type |
|
99 |
*/ |
|
100 |
public void setType(String type) { |
|
101 |
this.type = type; |
|
102 |
selfElement.setAttribute("type", type); //$NON-NLS-1$ |
|
103 |
} |
|
104 |
|
|
105 |
/** |
|
106 |
* Sets the key. |
|
107 |
* |
|
108 |
* @param key the new key |
|
109 |
*/ |
|
110 |
public void setKey(String key) { |
|
111 |
this.key = key; |
|
112 |
selfElement.setAttribute("key", key); //$NON-NLS-1$ |
|
113 |
} |
|
114 |
|
|
115 |
/* (non-Javadoc) |
|
116 |
* @see java.lang.Object#toString() |
|
117 |
*/ |
|
118 |
@Override |
|
119 |
public String toString() |
|
120 |
{ |
|
121 |
return (String) value; |
|
122 |
} |
|
123 |
} |
tmp/org.txm.core/src/java/org/txm/objects/Page.java (revision 3233) | ||
---|---|---|
102 | 102 |
return edition; |
103 | 103 |
} |
104 | 104 |
|
105 |
public boolean equals(Page p) { |
|
106 |
return p.idx == this.idx && p.name.equals(this.name) && p.htmlfile.equals(this.htmlfile); |
|
107 |
} |
|
108 |
|
|
105 | 109 |
/** |
106 | 110 |
* Gets the file. |
107 | 111 |
* |
tmp/org.txm.core/src/java/org/txm/utils/ConsoleProgressBar.java (revision 3233) | ||
---|---|---|
53 | 53 |
} |
54 | 54 |
} |
55 | 55 |
} |
56 |
|
|
56 |
|
|
57 | 57 |
public static void main(String[] args) { |
58 | 58 |
int[] amounts = {10,42,150,155,15000,150000}; |
59 | 59 |
for (int amount : amounts) { |
... | ... | |
67 | 67 |
public void worked(int amount, String message) { |
68 | 68 |
this.tick(); |
69 | 69 |
System.out.println(message); |
70 |
|
|
71 | 70 |
} |
72 | 71 |
|
73 | 72 |
public void setMessage(String message) { |
74 |
System.out.println(message); |
|
73 |
String space = String.format("%"+(4+point_progress)+"s", " "); |
|
74 |
System.out.println("\n"+space+message); |
|
75 |
System.out.print(space); |
|
75 | 76 |
} |
76 | 77 |
|
77 | 78 |
@Override |
tmp/org.txm.core/src/java/org/txm/importer/ValidateXml.java (revision 3233) | ||
---|---|---|
156 | 156 |
*/ |
157 | 157 |
public static boolean test(File infile) { |
158 | 158 |
if (infile.isDirectory()) { |
159 |
System.out.println(NLS.bind(TXMCoreMessages.xmlValidationColonP0IsADirectory, infile));
|
|
159 |
Log.warning(NLS.bind(TXMCoreMessages.xmlValidationColonP0IsADirectory, infile));
|
|
160 | 160 |
return false; |
161 | 161 |
} |
162 | 162 |
if (!infile.exists()) { |
163 |
System.out.println(NLS.bind(TXMCoreMessages.xmlValidationColonP0DoesNotExists, infile));
|
|
163 |
Log.warning(NLS.bind(TXMCoreMessages.xmlValidationColonP0DoesNotExists, infile));
|
|
164 | 164 |
return false; |
165 | 165 |
} |
166 | 166 |
if (!infile.canRead()) { |
167 |
System.out.println(NLS.bind(TXMCoreMessages.xmlValidationColonP0IsNotReadable, infile));
|
|
167 |
Log.warning(NLS.bind(TXMCoreMessages.xmlValidationColonP0IsNotReadable, infile));
|
|
168 | 168 |
return false; |
169 | 169 |
} |
170 |
|
|
170 | 171 |
try { |
171 | 172 |
URL url = infile.toURI().toURL(); |
172 | 173 |
InputStream inputData = url.openStream(); |
... | ... | |
180 | 181 |
return true; |
181 | 182 |
} |
182 | 183 |
catch (Exception e) { |
183 |
System.out.println(getXMLError(infile.toString(), e));
|
|
184 |
Log.warning(getXMLError(infile.toString(), e));
|
|
184 | 185 |
return false; |
185 | 186 |
} |
186 | 187 |
} |
tmp/org.txm.core/src/java/org/txm/scripts/importer/StaxStackWriter.java (revision 3233) | ||
---|---|---|
79 | 79 |
} |
80 | 80 |
} |
81 | 81 |
} |
82 |
System.out.println("reopened: "+events); |
|
82 |
//System.out.println("reopened: "+events);
|
|
83 | 83 |
} |
84 | 84 |
|
85 | 85 |
public List<List<List>> getTagStack() { |
Formats disponibles : Unified diff