Révision 3552
TXM/trunk/org.txm.index.rcp/src/org/txm/index/rcp/editors/PartitionIndexEditor.java (revision 3552) | ||
---|---|---|
455 | 455 |
for (int i = 0; i < partnames.size(); i++) { |
456 | 456 |
|
457 | 457 |
if (i >= MAX_NUMBER_OF_COLUMNS) { |
458 |
Log.warning(NLS.bind("Warning The number of columns exceeds {0}. the table has been cut. You can, change the maximum in the TXM > User preference page", MAX_NUMBER_OF_COLUMNS));
|
|
458 |
Log.warning(NLS.bind("Warning The number of columns exceeds {0} ({1}). the table has been cut. You can, change the maximum in the TXM > User preference page", MAX_NUMBER_OF_COLUMNS, partnames.size()));
|
|
459 | 459 |
break; |
460 | 460 |
} |
461 | 461 |
|
TXM/trunk/org.txm.treesearch.rcp/src/org/txm/treesearch/editor/TreeSearchEditor.java (revision 3552) | ||
---|---|---|
7 | 7 |
|
8 | 8 |
import org.eclipse.swt.SWT; |
9 | 9 |
import org.eclipse.swt.browser.Browser; |
10 |
import org.eclipse.swt.events.MouseEvent; |
|
11 |
import org.eclipse.swt.events.MouseWheelListener; |
|
10 | 12 |
import org.eclipse.swt.events.SelectionEvent; |
11 | 13 |
import org.eclipse.swt.events.SelectionListener; |
12 | 14 |
import org.eclipse.swt.layout.GridData; |
... | ... | |
28 | 30 |
import org.txm.core.results.Parameter; |
29 | 31 |
import org.txm.edition.rcp.handlers.OpenEdition; |
30 | 32 |
import org.txm.rcp.IImageKeys; |
33 |
import org.txm.rcp.editors.TXMBrowserEditor; |
|
31 | 34 |
import org.txm.rcp.editors.TXMEditor; |
32 | 35 |
import org.txm.rcp.editors.TXMResultEditorInput; |
33 | 36 |
import org.txm.rcp.messages.TXMUIMessages; |
... | ... | |
296 | 299 |
} |
297 | 300 |
}); |
298 | 301 |
|
302 |
search.setImage(IImageKeys.getImage(IImageKeys.ACTION_SEARCH)); |
|
303 |
queryArea.setVisible(false); |
|
304 |
queryAreaLabel.setVisible(false); |
|
305 |
queryAreaLayoutData.heightHint = 0; |
|
306 |
queryAreaLayoutData.minimumHeight = 0; |
|
307 |
queryAreaLayoutData.grabExcessVerticalSpace = false; |
|
308 |
queryAreaLayoutData.grabExcessHorizontalSpace = false; |
|
309 |
|
|
299 | 310 |
// fill param Area |
300 | 311 |
Label l3 = new Label(navigationAreaComposite, SWT.NONE); |
301 | 312 |
l3.setText("Match "); //$NON-NLS-1$ |
... | ... | |
342 | 353 |
svgPanel = new Browser(mainPanel, SWT.EMBEDDED | SWT.NO_BACKGROUND); |
343 | 354 |
svgPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
344 | 355 |
|
356 |
svgPanel.addMouseWheelListener(new MouseWheelListener() { |
|
357 |
|
|
358 |
@Override |
|
359 |
public void mouseScrolled(MouseEvent e) { |
|
360 |
|
|
361 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
362 |
if (e.count > 0) { |
|
363 |
TXMBrowserEditor.zoomIn(svgPanel); |
|
364 |
} else { |
|
365 |
TXMBrowserEditor.zoomOut(svgPanel); |
|
366 |
} |
|
367 |
} |
|
368 |
} |
|
369 |
}); |
|
370 |
|
|
345 | 371 |
// this.getTopToolbar().setVisible(COMPUTING_PARAMETERS_GROUP_ID, true); |
346 | 372 |
initializeFields(); |
347 | 373 |
} |
TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java (revision 3552) | ||
---|---|---|
30 | 30 |
import org.eclipse.swt.events.MenuListener; |
31 | 31 |
import org.eclipse.swt.events.MouseEvent; |
32 | 32 |
import org.eclipse.swt.events.MouseListener; |
33 |
import org.eclipse.swt.events.MouseWheelListener; |
|
33 | 34 |
import org.eclipse.swt.events.SelectionEvent; |
34 | 35 |
import org.eclipse.swt.events.SelectionListener; |
35 | 36 |
import org.eclipse.swt.widgets.Composite; |
... | ... | |
46 | 47 |
import org.txm.rcp.StatusLine; |
47 | 48 |
import org.txm.rcp.commands.ShowSelected; |
48 | 49 |
import org.txm.rcp.editors.CommandLink; |
50 |
import org.txm.rcp.editors.TXMBrowserEditor; |
|
49 | 51 |
import org.txm.rcp.utils.IOClipboard; |
50 | 52 |
import org.txm.utils.io.IOUtils; |
51 | 53 |
import org.txm.utils.logger.Log; |
... | ... | |
719 | 721 |
} |
720 | 722 |
}); |
721 | 723 |
|
724 |
browser.addMouseWheelListener(new MouseWheelListener() { |
|
725 |
|
|
726 |
@Override |
|
727 |
public void mouseScrolled(MouseEvent e) { |
|
728 |
|
|
729 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
730 |
if (e.count > 0) { |
|
731 |
TXMBrowserEditor.zoomIn(getBrowser()); |
|
732 |
} else { |
|
733 |
TXMBrowserEditor.zoomOut(getBrowser()); |
|
734 |
} |
|
735 |
} |
|
736 |
} |
|
737 |
}); |
|
738 |
|
|
722 | 739 |
KeyListener kListener = new KeyListener() { |
723 | 740 |
|
724 | 741 |
boolean debug = true; |
... | ... | |
1463 | 1480 |
String text = EditionPanel.this.getTextSelection(); |
1464 | 1481 |
copyItem.setEnabled(text != null && text.length() > 0); |
1465 | 1482 |
|
1483 |
MenuItem zoomInItem = new MenuItem(menu, SWT.NONE); |
|
1484 |
zoomInItem.setText("Zoom avant"); |
|
1485 |
zoomInItem.addSelectionListener(new SelectionListener() { |
|
1486 |
|
|
1487 |
@Override |
|
1488 |
public void widgetSelected(SelectionEvent e) { |
|
1489 |
TXMBrowserEditor.zoomIn(browser); |
|
1490 |
} |
|
1491 |
|
|
1492 |
@Override |
|
1493 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
1494 |
}); |
|
1495 |
|
|
1496 |
MenuItem zoomOutItem = new MenuItem(menu, SWT.NONE); |
|
1497 |
zoomOutItem.setText("Zoom arrière"); |
|
1498 |
zoomOutItem.addSelectionListener(new SelectionListener() { |
|
1499 |
|
|
1500 |
@Override |
|
1501 |
public void widgetSelected(SelectionEvent e) { |
|
1502 |
|
|
1503 |
TXMBrowserEditor.zoomOut(browser); |
|
1504 |
} |
|
1505 |
|
|
1506 |
@Override |
|
1507 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
1508 |
}); |
|
1509 |
|
|
1510 |
MenuItem zoomResetItem = new MenuItem(menu, SWT.NONE); |
|
1511 |
zoomResetItem.setText("Zoom initial"); |
|
1512 |
zoomResetItem.addSelectionListener(new SelectionListener() { |
|
1513 |
|
|
1514 |
@Override |
|
1515 |
public void widgetSelected(SelectionEvent e) { |
|
1516 |
|
|
1517 |
TXMBrowserEditor.zoomReset(browser); |
|
1518 |
} |
|
1519 |
|
|
1520 |
@Override |
|
1521 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
1522 |
}); |
|
1523 |
|
|
1466 | 1524 |
MenuItem reloadItem = new MenuItem(menu, SWT.NONE); |
1467 | 1525 |
reloadItem.setText(EditionUIMessages.reload); |
1468 | 1526 |
reloadItem.addSelectionListener(new SelectionListener() { |
TXM/trunk/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesEditor.java (revision 3552) | ||
---|---|---|
7 | 7 |
import org.eclipse.swt.SWT; |
8 | 8 |
import org.eclipse.swt.browser.Browser; |
9 | 9 |
import org.eclipse.swt.custom.StyledText; |
10 |
import org.eclipse.swt.events.MouseEvent; |
|
11 |
import org.eclipse.swt.events.MouseWheelListener; |
|
10 | 12 |
import org.eclipse.swt.events.SelectionEvent; |
11 | 13 |
import org.eclipse.swt.events.SelectionListener; |
12 | 14 |
import org.eclipse.swt.layout.GridData; |
... | ... | |
24 | 26 |
import org.txm.properties.core.preferences.PropertiesPreferences; |
25 | 27 |
import org.txm.properties.rcp.messages.PropertiesUIMessages; |
26 | 28 |
import org.txm.rcp.IImageKeys; |
29 |
import org.txm.rcp.editors.TXMBrowserEditor; |
|
27 | 30 |
import org.txm.rcp.editors.TXMEditor; |
28 | 31 |
import org.txm.rcp.editors.listeners.ComputeSelectionListener; |
29 | 32 |
import org.txm.rcp.swt.GLComposite; |
... | ... | |
146 | 149 |
|
147 | 150 |
this.browser = new Browser(displayArea, SWT.NONE); |
148 | 151 |
this.browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); |
152 |
|
|
153 |
browser.addMouseWheelListener(new MouseWheelListener() { |
|
154 |
|
|
155 |
@Override |
|
156 |
public void mouseScrolled(MouseEvent e) { |
|
157 |
|
|
158 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
159 |
if (e.count > 0) { |
|
160 |
TXMBrowserEditor.zoomIn(browser); |
|
161 |
} else { |
|
162 |
TXMBrowserEditor.zoomOut(browser); |
|
163 |
} |
|
164 |
} |
|
165 |
} |
|
166 |
}); |
|
149 | 167 |
} |
150 | 168 |
|
151 | 169 |
@Override |
TXM/trunk/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesTXMResultTab.java (revision 3552) | ||
---|---|---|
5 | 5 |
|
6 | 6 |
import org.eclipse.swt.SWT; |
7 | 7 |
import org.eclipse.swt.browser.Browser; |
8 |
import org.eclipse.swt.events.MouseEvent; |
|
9 |
import org.eclipse.swt.events.MouseWheelListener; |
|
8 | 10 |
import org.eclipse.swt.layout.GridData; |
9 | 11 |
import org.eclipse.swt.widgets.Label; |
10 | 12 |
import org.eclipse.swt.widgets.TabFolder; |
11 | 13 |
import org.eclipse.swt.widgets.TabItem; |
12 | 14 |
import org.txm.core.results.TXMResult; |
13 | 15 |
import org.txm.properties.rcp.Messages; |
16 |
import org.txm.rcp.editors.TXMBrowserEditor; |
|
14 | 17 |
import org.txm.rcp.swt.GLComposite; |
15 | 18 |
import org.txm.utils.logger.Log; |
16 | 19 |
|
... | ... | |
37 | 40 |
protected void buildContent(GLComposite parent) { |
38 | 41 |
this.browser = new Browser(parent, SWT.NONE); |
39 | 42 |
this.browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); |
43 |
|
|
44 |
browser.addMouseWheelListener(new MouseWheelListener() { |
|
45 |
|
|
46 |
@Override |
|
47 |
public void mouseScrolled(MouseEvent e) { |
|
48 |
|
|
49 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
50 |
if (e.count > 0) { |
|
51 |
TXMBrowserEditor.zoomIn(browser); |
|
52 |
} else { |
|
53 |
TXMBrowserEditor.zoomOut(browser); |
|
54 |
} |
|
55 |
} |
|
56 |
} |
|
57 |
}); |
|
40 | 58 |
} |
41 | 59 |
|
42 | 60 |
@Override |
TXM/trunk/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/DocumentationTab.java (revision 3552) | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import org.eclipse.swt.SWT; |
4 | 4 |
import org.eclipse.swt.browser.Browser; |
5 |
import org.eclipse.swt.events.MouseEvent; |
|
6 |
import org.eclipse.swt.events.MouseWheelListener; |
|
5 | 7 |
import org.eclipse.swt.events.SelectionListener; |
6 | 8 |
import org.eclipse.swt.layout.GridData; |
7 | 9 |
import org.eclipse.swt.widgets.Composite; |
... | ... | |
13 | 15 |
import org.txm.objects.Project; |
14 | 16 |
import org.txm.properties.rcp.messages.PropertiesUIMessages; |
15 | 17 |
import org.txm.rcp.IImageKeys; |
18 |
import org.txm.rcp.editors.TXMBrowserEditor; |
|
16 | 19 |
import org.txm.rcp.swt.GLComposite; |
17 | 20 |
import org.txm.utils.logger.Log; |
18 | 21 |
|
... | ... | |
43 | 46 |
createToolbar(parent); |
44 | 47 |
this.browser = new Browser(parent, SWT.NONE); |
45 | 48 |
this.browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); |
49 |
|
|
50 |
browser.addMouseWheelListener(new MouseWheelListener() { |
|
51 |
|
|
52 |
@Override |
|
53 |
public void mouseScrolled(MouseEvent e) { |
|
54 |
|
|
55 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
56 |
if (e.count > 0) { |
|
57 |
TXMBrowserEditor.zoomIn(browser); |
|
58 |
} else { |
|
59 |
TXMBrowserEditor.zoomOut(browser); |
|
60 |
} |
|
61 |
} |
|
62 |
} |
|
63 |
}); |
|
46 | 64 |
} |
47 | 65 |
|
48 | 66 |
private ToolBar createToolbar(Composite parent) { |
TXM/trunk/org.txm.properties.rcp/src/org/txm/properties/rcp/editors/PropertiesGeneralTab.java (revision 3552) | ||
---|---|---|
8 | 8 |
import org.eclipse.swt.browser.Browser; |
9 | 9 |
import org.eclipse.swt.events.KeyEvent; |
10 | 10 |
import org.eclipse.swt.events.KeyListener; |
11 |
import org.eclipse.swt.events.MouseEvent; |
|
12 |
import org.eclipse.swt.events.MouseWheelListener; |
|
11 | 13 |
import org.eclipse.swt.events.SelectionEvent; |
12 | 14 |
import org.eclipse.swt.events.SelectionListener; |
13 | 15 |
import org.eclipse.swt.graphics.Image; |
... | ... | |
20 | 22 |
import org.txm.properties.rcp.Messages; |
21 | 23 |
import org.txm.properties.rcp.messages.PropertiesUIMessages; |
22 | 24 |
import org.txm.rcp.IImageKeys; |
25 |
import org.txm.rcp.editors.TXMBrowserEditor; |
|
23 | 26 |
import org.txm.rcp.views.corpora.CorporaView; |
24 | 27 |
|
25 | 28 |
public class PropertiesGeneralTab extends PropertiesTab { |
26 | 29 |
|
27 | 30 |
private Text nameField; |
31 |
private Browser browser; |
|
28 | 32 |
|
29 | 33 |
public PropertiesGeneralTab(TabFolder folder, PropertiesPagedEditor editor2) { |
30 | 34 |
super(folder, editor2); |
... | ... | |
147 | 151 |
l.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false)); |
148 | 152 |
l.setText(PropertiesUIMessages.Description); |
149 | 153 |
|
150 |
Browser b = new Browser(parent, SWT.H_SCROLL | SWT.V_SCROLL); |
|
151 |
b.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 1, 1)); |
|
152 |
b.setText(editor.getResult().getProject().getDescription()); |
|
154 |
browser = new Browser(parent, SWT.H_SCROLL | SWT.V_SCROLL); |
|
155 |
browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 1, 1)); |
|
156 |
browser.setText(editor.getResult().getProject().getDescription()); |
|
157 |
|
|
158 |
browser.addMouseWheelListener(new MouseWheelListener() { |
|
159 |
|
|
160 |
@Override |
|
161 |
public void mouseScrolled(MouseEvent e) { |
|
162 |
|
|
163 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
164 |
if (e.count > 0) { |
|
165 |
TXMBrowserEditor.zoomIn(browser); |
|
166 |
} else { |
|
167 |
TXMBrowserEditor.zoomOut(browser); |
|
168 |
} |
|
169 |
} |
|
170 |
} |
|
171 |
}); |
|
153 | 172 |
} |
154 | 173 |
|
155 | 174 |
public void toClipboard() { |
TXM/trunk/org.txm.whatsnew.rcp/src/org/txm/whatsnew/rcp/NewsEditor.java (revision 3552) | ||
---|---|---|
6 | 6 |
import org.eclipse.core.runtime.IProgressMonitor; |
7 | 7 |
import org.eclipse.swt.SWT; |
8 | 8 |
import org.eclipse.swt.browser.Browser; |
9 |
import org.eclipse.swt.events.MouseEvent; |
|
10 |
import org.eclipse.swt.events.MouseWheelListener; |
|
9 | 11 |
import org.eclipse.swt.events.SelectionEvent; |
10 | 12 |
import org.eclipse.swt.events.SelectionListener; |
11 | 13 |
import org.eclipse.swt.layout.GridData; |
... | ... | |
21 | 23 |
import org.txm.core.preferences.TBXPreferences; |
22 | 24 |
import org.txm.rcp.Activator; |
23 | 25 |
import org.txm.rcp.IImageKeys; |
26 |
import org.txm.rcp.editors.TXMBrowserEditor; |
|
24 | 27 |
import org.txm.rcp.p2.plugins.TXMUpdateHandler; |
25 | 28 |
import org.txm.utils.io.IOUtils; |
26 | 29 |
import org.txm.utils.logger.Log; |
... | ... | |
145 | 148 |
browser = new Browser(parent, SWT.EMBEDDED); |
146 | 149 |
browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); |
147 | 150 |
|
151 |
browser.addMouseWheelListener(new MouseWheelListener() { |
|
152 |
|
|
153 |
@Override |
|
154 |
public void mouseScrolled(MouseEvent e) { |
|
155 |
|
|
156 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
157 |
if (e.count > 0) { |
|
158 |
TXMBrowserEditor.zoomIn(browser); |
|
159 |
} else { |
|
160 |
TXMBrowserEditor.zoomOut(browser); |
|
161 |
} |
|
162 |
} |
|
163 |
} |
|
164 |
}); |
|
148 | 165 |
refreshNews(); |
149 | 166 |
} |
150 | 167 |
|
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowserEditor.java (revision 3552) | ||
---|---|---|
42 | 42 |
import org.eclipse.swt.events.DisposeListener; |
43 | 43 |
import org.eclipse.swt.events.MenuEvent; |
44 | 44 |
import org.eclipse.swt.events.MenuListener; |
45 |
import org.eclipse.swt.events.MouseEvent; |
|
46 |
import org.eclipse.swt.events.MouseWheelListener; |
|
45 | 47 |
import org.eclipse.swt.events.SelectionEvent; |
46 | 48 |
import org.eclipse.swt.events.SelectionListener; |
47 | 49 |
import org.eclipse.swt.graphics.Image; |
... | ... | |
125 | 127 |
getBrowser().addProgressListener(progresslistener); |
126 | 128 |
} |
127 | 129 |
|
130 |
public static void zoomIn(Browser b) { |
|
131 |
zoom(b, 0.1f); |
|
132 |
} |
|
133 |
|
|
134 |
public static void zoomOut(Browser b) { |
|
135 |
zoom(b, -0.1f); |
|
136 |
} |
|
137 |
|
|
138 |
public static void zoomReset(Browser b) { |
|
139 |
zoom(b, 0f); |
|
140 |
} |
|
141 |
|
|
142 |
public static void zoom(Browser b, float diff) { |
|
143 |
|
|
144 |
if (b == null || b.isDisposed()) return; |
|
145 |
|
|
146 |
// b.evaluate("alert(document);"); |
|
147 |
// b.evaluate("alert(document.children[0].style);"); |
|
148 |
// b.evaluate("alert(document.children[0].children[1]);"); |
|
149 |
boolean isHTML = (boolean) b.evaluate("return document.getElementsByTagName('body')[0] != null;"); |
|
150 |
if (isHTML) { |
|
151 |
String zoom = (String) b.evaluate("return document.getElementsByTagName('body')[0].style.zoom;"); |
|
152 |
if (zoom == null || zoom.isEmpty()) { |
|
153 |
zoom = "1.0"; |
|
154 |
} |
|
155 |
|
|
156 |
float fzoom = Float.parseFloat(zoom) + diff; |
|
157 |
if (diff == 0f) { |
|
158 |
fzoom = 1.0f; |
|
159 |
} |
|
160 |
|
|
161 |
b.evaluate("document.getElementsByTagName('body')[0].style.zoom = \""+fzoom+"\";"); |
|
162 |
} else { |
|
163 |
String zoom = (String) b.evaluate("return document.children[0].style.zoom;"); |
|
164 |
if (zoom == null || zoom.isEmpty()) { |
|
165 |
zoom = "1.0"; |
|
166 |
} |
|
167 |
|
|
168 |
float fzoom = Float.parseFloat(zoom) + diff; |
|
169 |
if (diff == 0f) { |
|
170 |
fzoom = 1.0f; |
|
171 |
} |
|
172 |
|
|
173 |
b.evaluate("document.children[0].style.zoom = \""+fzoom+"\";"); |
|
174 |
} |
|
175 |
} |
|
176 |
|
|
128 | 177 |
public void initMenu() { |
129 | 178 |
|
130 | 179 |
// create a new menu |
... | ... | |
160 | 209 |
String text = TXMBrowserEditor.this.getTextSelection(); |
161 | 210 |
copyItem.setEnabled(text != null && text.length() > 0); |
162 | 211 |
|
212 |
MenuItem zoomInItem = new MenuItem(menu, SWT.NONE); |
|
213 |
zoomInItem.setText("Zoom avant"); |
|
214 |
zoomInItem.addSelectionListener(new SelectionListener() { |
|
215 |
|
|
216 |
@Override |
|
217 |
public void widgetSelected(SelectionEvent e) { |
|
218 |
zoomIn(getBrowser()); |
|
219 |
} |
|
220 |
|
|
221 |
@Override |
|
222 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
223 |
}); |
|
224 |
|
|
225 |
MenuItem zoomOutItem = new MenuItem(menu, SWT.NONE); |
|
226 |
zoomOutItem.setText("Zoom arrière"); |
|
227 |
zoomOutItem.addSelectionListener(new SelectionListener() { |
|
228 |
|
|
229 |
@Override |
|
230 |
public void widgetSelected(SelectionEvent e) { |
|
231 |
|
|
232 |
zoomOut(getBrowser()); |
|
233 |
} |
|
234 |
|
|
235 |
@Override |
|
236 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
237 |
}); |
|
238 |
|
|
239 |
MenuItem zoomResetItem = new MenuItem(menu, SWT.NONE); |
|
240 |
zoomResetItem.setText("Zoom initial"); |
|
241 |
zoomResetItem.addSelectionListener(new SelectionListener() { |
|
242 |
|
|
243 |
@Override |
|
244 |
public void widgetSelected(SelectionEvent e) { |
|
245 |
|
|
246 |
zoomReset(getBrowser()); |
|
247 |
} |
|
248 |
|
|
249 |
@Override |
|
250 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
251 |
}); |
|
252 |
|
|
163 | 253 |
MenuItem reloadItem = new MenuItem(menu, SWT.NONE); |
164 | 254 |
reloadItem.setText(TXMUIMessages.Reload); |
165 | 255 |
reloadItem.addSelectionListener(new SelectionListener() { |
... | ... | |
426 | 516 |
// // System.out.println("Next texts "+nextText); |
427 | 517 |
// } |
428 | 518 |
|
519 |
public static void installZoomControls(Browser browser, Menu menu) { |
|
520 |
|
|
521 |
browser.addMouseWheelListener(new MouseWheelListener() { |
|
522 |
|
|
523 |
@Override |
|
524 |
public void mouseScrolled(MouseEvent e) { |
|
525 |
|
|
526 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
527 |
if (e.count > 0) { |
|
528 |
zoomIn(browser); |
|
529 |
} else { |
|
530 |
zoomOut(browser); |
|
531 |
} |
|
532 |
} |
|
533 |
} |
|
534 |
}); |
|
535 |
|
|
536 |
|
|
537 |
MenuItem zoomInItem = new MenuItem(menu, SWT.NONE); |
|
538 |
zoomInItem.setText("Zoom avant"); |
|
539 |
zoomInItem.addSelectionListener(new SelectionListener() { |
|
540 |
|
|
541 |
@Override |
|
542 |
public void widgetSelected(SelectionEvent e) { |
|
543 |
zoomIn(browser); |
|
544 |
} |
|
545 |
|
|
546 |
@Override |
|
547 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
548 |
}); |
|
549 |
|
|
550 |
MenuItem zoomOutItem = new MenuItem(menu, SWT.NONE); |
|
551 |
zoomOutItem.setText("Zoom arrière"); |
|
552 |
zoomOutItem.addSelectionListener(new SelectionListener() { |
|
553 |
|
|
554 |
@Override |
|
555 |
public void widgetSelected(SelectionEvent e) { |
|
556 |
|
|
557 |
zoomOut(browser); |
|
558 |
} |
|
559 |
|
|
560 |
@Override |
|
561 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
562 |
}); |
|
563 |
|
|
564 |
MenuItem zoomResetItem = new MenuItem(menu, SWT.NONE); |
|
565 |
zoomResetItem.setText("Zoom initial"); |
|
566 |
zoomResetItem.addSelectionListener(new SelectionListener() { |
|
567 |
|
|
568 |
@Override |
|
569 |
public void widgetSelected(SelectionEvent e) { |
|
570 |
|
|
571 |
zoomReset(browser); |
|
572 |
} |
|
573 |
|
|
574 |
@Override |
|
575 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
576 |
}); |
|
577 |
} |
|
578 |
|
|
429 | 579 |
/* |
430 | 580 |
* (non-Javadoc) |
431 | 581 |
* @see org.eclipse.ui.internal.browser.WebBrowserEditor#createPartControl(org.eclipse.swt.widgets.Composite) |
... | ... | |
452 | 602 |
return; |
453 | 603 |
} |
454 | 604 |
|
605 |
|
|
455 | 606 |
// RowLayout navigLayout = new RowLayout(SWT.HORIZONTAL); |
456 | 607 |
// navigLayout.justify = true; |
457 | 608 |
// Composite panneau = new Composite(parent, SWT.NONE); |
... | ... | |
629 | 780 |
// parent.setLayout(parentLayout); |
630 | 781 |
// parent.pack(); |
631 | 782 |
|
632 |
// MenuManager menuManager = new MenuManager(); |
|
633 |
// Menu menu = menuManager.createContextMenu(getBrowser()); |
|
634 |
// |
|
635 |
// // Set the MenuManager |
|
636 |
// getBrowser().setMenu(menu); |
|
783 |
// MenuManager menuManager = new MenuManager();
|
|
784 |
// Menu menu = menuManager.createContextMenu(getBrowser());
|
|
785 |
//
|
|
786 |
// // Set the MenuManager
|
|
787 |
// getBrowser().setMenu(menu);
|
|
637 | 788 |
|
638 | 789 |
initMenu(); |
639 | 790 |
|
791 |
getBrowser().addMouseWheelListener(new MouseWheelListener() { |
|
792 |
|
|
793 |
@Override |
|
794 |
public void mouseScrolled(MouseEvent e) { |
|
795 |
|
|
796 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
797 |
if (e.count > 0) { |
|
798 |
zoomIn(getBrowser()); |
|
799 |
} else { |
|
800 |
zoomOut(getBrowser()); |
|
801 |
} |
|
802 |
} |
|
803 |
} |
|
804 |
}); |
|
805 |
|
|
640 | 806 |
ISelectionProvider selProvider = new ISelectionProvider() { |
641 | 807 |
|
642 | 808 |
@Override |
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/___SWTAWTFocusBugsSnippet.java (revision 3552) | ||
---|---|---|
1 |
package org.txm.rcp; |
|
2 |
|
|
3 |
import java.awt.BorderLayout; |
|
4 |
import java.awt.Frame; |
|
5 |
import java.awt.Panel; |
|
6 |
import java.awt.TextField; |
|
7 |
|
|
8 |
import org.eclipse.swt.SWT; |
|
9 |
import org.eclipse.swt.awt.SWT_AWT; |
|
10 |
import org.eclipse.swt.layout.FillLayout; |
|
11 |
import org.eclipse.swt.widgets.Composite; |
|
12 |
import org.eclipse.swt.widgets.Display; |
|
13 |
import org.eclipse.swt.widgets.Shell; |
|
14 |
import org.eclipse.swt.widgets.Text; |
|
15 |
|
|
16 |
public class ___SWTAWTFocusBugsSnippet { |
|
17 |
|
|
18 |
public static void main(String[] args) { |
|
19 |
|
|
20 |
final Display display = new Display(); |
|
21 |
final Shell shell = new Shell(display); |
|
22 |
shell.setLayout(new FillLayout()); |
|
23 |
|
|
24 |
Composite composite = new Composite(shell, SWT.EMBEDDED); |
|
25 |
|
|
26 |
Frame frame = SWT_AWT.new_Frame(composite); |
|
27 |
Panel panel = new Panel(new BorderLayout()); |
|
28 |
frame.add(panel); |
|
29 |
panel.add(new TextField()); |
|
30 |
|
|
31 |
Text text = new Text(shell, SWT.BORDER); |
|
32 |
shell.setSize(200,70); |
|
33 |
shell.open(); |
|
34 |
|
|
35 |
while(!shell.isDisposed()) { |
|
36 |
if (!display.readAndDispatch()) { |
|
37 |
display.sleep(); |
|
38 |
} |
|
39 |
} |
|
40 |
display.dispose(); |
|
41 |
} |
|
42 |
} |
|
0 | 43 |
TXM/trunk/org.txm.core/src/java/org/txm/importer/StaxIdentityParser.java (revision 3552) | ||
---|---|---|
476 | 476 |
} |
477 | 477 |
|
478 | 478 |
protected void processComment() throws XMLStreamException { |
479 |
writer.writeComment(parser.getText()); |
|
479 |
writer.writeComment(parser.getText().replace("--", "―"));
|
|
480 | 480 |
} |
481 | 481 |
|
482 | 482 |
protected void processEndElement() throws XMLStreamException { |
TXM/trunk/org.txm.core/src/java/org/txm/importer/scripts/xmltxm/AnnotationInjection.groovy (revision 3552) | ||
---|---|---|
149 | 149 |
writer.writeCharacters(headerparser.getText()); |
150 | 150 |
} else if (event == XMLStreamConstants.COMMENT) { |
151 | 151 |
if (start) |
152 |
writer.writeComment(headerparser.getText()); |
|
152 |
writer.writeComment(headerparser.getText().replace("--", "―"));
|
|
153 | 153 |
} |
154 | 154 |
} |
155 | 155 |
headerparser.close(); |
TXM/trunk/org.txm.core/src/java/org/txm/importer/scripts/xmltxm/AnnotationInjectionFromTTOutput.groovy (revision 3552) | ||
---|---|---|
132 | 132 |
writer.writeCharacters(headerparser.getText()); |
133 | 133 |
} else if (event == XMLStreamConstants.COMMENT) { |
134 | 134 |
if (start) |
135 |
writer.writeComment(headerparser.getText()); |
|
135 |
writer.writeComment(headerparser.getText().replace("--", "―"));
|
|
136 | 136 |
} |
137 | 137 |
} |
138 | 138 |
headerparser.close(); |
TXM/trunk/org.txm.core/src/java/org/txm/scripts/importer/SplitBy.groovy (revision 3552) | ||
---|---|---|
164 | 164 |
} |
165 | 165 |
else if (event == XMLStreamConstants.COMMENT) |
166 | 166 |
{ |
167 |
writer.writeComment(parser.getText()); |
|
167 |
writer.writeComment(parser.getText().replace("--", "―"));
|
|
168 | 168 |
} |
169 | 169 |
} |
170 | 170 |
|
TXM/trunk/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotationInjectionFromTTOutput.groovy (revision 3552) | ||
---|---|---|
132 | 132 |
writer.writeCharacters(headerparser.getText()); |
133 | 133 |
} else if (event == XMLStreamConstants.COMMENT) { |
134 | 134 |
if (start) |
135 |
writer.writeComment(headerparser.getText()); |
|
135 |
writer.writeComment(headerparser.getText().replace("--", "―"));
|
|
136 | 136 |
} |
137 | 137 |
} |
138 | 138 |
headerparser.close(); |
TXM/trunk/org.txm.connlu.core/template/index.html (revision 3552) | ||
---|---|---|
2 | 2 |
<html> |
3 | 3 |
|
4 | 4 |
<head> |
5 |
<meta charset="utf-8"> |
|
6 |
<title>conllu.js</title> |
|
7 |
<meta name="viewport" content="width=device-width"> |
|
8 |
<meta name="description" content="CoNLL-U format library for JavaScript"> |
|
5 |
|
|
6 |
<title>UD</title> |
|
7 |
<meta charset="utf-8"></meta> |
|
8 |
<meta name="viewport" content="width=device-width"></meta> |
|
9 |
<meta name="description" content="CoNLL-U format library for JavaScript"></meta> |
|
9 | 10 |
|
10 |
<link rel="stylesheet" href="HTMLROOTDIRECTORY/css/jquery-ui-redmond.css"> |
|
11 |
<link rel="stylesheet" href="HTMLROOTDIRECTORY/css/main.css"> |
|
12 |
<link rel="stylesheet" href="HTMLROOTDIRECTORY/css/style-vis.css"> |
|
11 |
<link rel="stylesheet" href="HTMLROOTDIRECTORY/css/jquery-ui-redmond.css"></link>
|
|
12 |
<link rel="stylesheet" href="HTMLROOTDIRECTORY/css/main.css"></link>
|
|
13 |
<link rel="stylesheet" href="HTMLROOTDIRECTORY/css/style-vis.css"></link>
|
|
13 | 14 |
|
14 | 15 |
<script type="text/javascript" src="HTMLROOTDIRECTORY/lib/ext/head.load.min.js"></script> |
15 | 16 |
</head> |
... | ... | |
18 | 19 |
|
19 | 20 |
<code class="conllu-parse" tabs="yes"><pre> |
20 | 21 |
CONLLUSENTENCE |
22 |
|
|
21 | 23 |
</pre></code> |
22 | 24 |
|
23 | 25 |
</body> |
24 | 26 |
|
25 | 27 |
<script type="text/javascript"> |
26 |
var root = 'HTMLROOTDIRECTORY'; // filled in by jekyll |
|
28 |
var root = 'HTMLROOTDIRECTORY/'; // filled in by jekyll
|
|
27 | 29 |
head.js( |
28 | 30 |
// External libraries |
29 |
root + '/lib/ext/jquery.min.js',
|
|
30 |
root + '/lib/ext/jquery.svg.min.js',
|
|
31 |
root + '/lib/ext/jquery.svgdom.min.js',
|
|
32 |
root + '/lib/ext/jquery-ui.min.js',
|
|
33 |
root + '/lib/ext/waypoints.min.js',
|
|
31 |
root + 'lib/ext/jquery.min.js', |
|
32 |
root + 'lib/ext/jquery.svg.min.js', |
|
33 |
root + 'lib/ext/jquery.svgdom.min.js', |
|
34 |
root + 'lib/ext/jquery-ui.min.js', |
|
35 |
root + 'lib/ext/waypoints.min.js', |
|
34 | 36 |
|
35 | 37 |
// brat helper modules |
36 |
root + '/lib/brat/configuration.js',
|
|
37 |
root + '/lib/brat/util.js',
|
|
38 |
root + '/lib/brat/annotation_log.js',
|
|
39 |
root + '/lib/ext/webfont.js',
|
|
38 |
root + 'lib/brat/configuration.js', |
|
39 |
root + 'lib/brat/util.js', |
|
40 |
root + 'lib/brat/annotation_log.js', |
|
41 |
root + 'lib/ext/webfont.js', |
|
40 | 42 |
// brat modules |
41 |
root + '/lib/brat/dispatcher.js',
|
|
42 |
root + '/lib/brat/url_monitor.js',
|
|
43 |
root + '/lib/brat/visualizer.js',
|
|
43 |
root + 'lib/brat/dispatcher.js', |
|
44 |
root + 'lib/brat/url_monitor.js', |
|
45 |
root + 'lib/brat/visualizer.js', |
|
44 | 46 |
|
45 | 47 |
// annotation documentation support |
46 | 48 |
'http://spyysalo.github.io/annodoc/lib/local/annodoc.js', |
47 |
root + '/lib/local/config.js',
|
|
49 |
root + 'lib/local/config.js', |
|
48 | 50 |
|
49 | 51 |
// the conllu.js library itself |
50 |
root + '/conllu.js'
|
|
52 |
root + 'conllu.js' |
|
51 | 53 |
); |
52 | 54 |
|
53 | 55 |
var webFontURLs = [ |
TXM/trunk/org.txm.connlu.core/groovy/org/txm/scripts/importer/conllu/CoNLLUImporter.groovy (revision 3552) | ||
---|---|---|
241 | 241 |
writer.writeCharacters("\n") |
242 | 242 |
|
243 | 243 |
for (def comment : comments) { |
244 |
writer.writeComment(comment) |
|
244 |
writer.writeComment(comment.replace("--", "―"))
|
|
245 | 245 |
writer.writeCharacters("\n") |
246 | 246 |
} |
247 | 247 |
|
TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/function/UDSearch.java (revision 3552) | ||
---|---|---|
368 | 368 |
public File createTemporaryFile(File resultDir) { |
369 | 369 |
|
370 | 370 |
try { |
371 |
String engine = UDTreePreferences.getInstance().getString(UDTreePreferences.ENGINE);
|
|
372 |
if (engine.equals("brat")) {
|
|
371 |
String engine = this.pVisualisation;//UDTreePreferences.getInstance().getString(UDTreePreferences.VISUALISATION);
|
|
372 |
if (engine.equals(UDTreePreferences.BRAT)) {
|
|
373 | 373 |
return File.createTempFile("UDTreeSearch", ".html", resultDir); |
374 | 374 |
} else { |
375 | 375 |
return File.createTempFile("UDTreeSearch", ".svg", resultDir); |
TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/function/BratPrintTree.java (revision 3552) | ||
---|---|---|
11 | 11 |
public class BratPrintTree { |
12 | 12 |
public static File print(File file, List<String> conll, String[] Tvalues, String[] NTvalues) { |
13 | 13 |
|
14 |
|
|
15 |
|
|
16 | 14 |
try { |
17 | 15 |
String bundle_id = "org.txm.conllu.core"; |
18 | 16 |
File HTMLTEMPATE = BundleUtils.getFile(bundle_id, "template", "/", "index.html"); |
... | ... | |
30 | 28 |
e.printStackTrace(); |
31 | 29 |
} |
32 | 30 |
|
33 |
|
|
34 | 31 |
return file; |
35 | 32 |
} |
36 | 33 |
} |
TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java (revision 3552) | ||
---|---|---|
273 | 273 |
for (int i = 0, firstLexicalTableColumnIndex = 3; i < len; i++, firstLexicalTableColumnIndex += 2) { |
274 | 274 |
|
275 | 275 |
if (i+3 >= MAX_NUMBER_OF_COLUMNS) { |
276 |
Log.warning(NLS.bind("Warning The number of columns exceeds {0}. the table has been cut. You can, change the maximum in the TXM > User preference page", MAX_NUMBER_OF_COLUMNS));
|
|
276 |
Log.warning(NLS.bind("Warning The number of columns exceeds {0} ({1}). the table has been cut. You can, change the maximum in the TXM > User preference page", MAX_NUMBER_OF_COLUMNS, len));
|
|
277 | 277 |
break; |
278 | 278 |
} |
279 | 279 |
|
... | ... | |
345 | 345 |
// Updating the table headers from lexical table values |
346 | 346 |
for (int i = 0, firstLexicalTableColumnIndex = 3; i < len; i++, firstLexicalTableColumnIndex += 2) { |
347 | 347 |
|
348 |
if (i+3 >= MAX_NUMBER_OF_COLUMNS) { |
|
348 |
if (i+3 >= MAX_NUMBER_OF_COLUMNS) { // stop the loop
|
|
349 | 349 |
// Log.warning(NLS.bind("Warning The number of columns exceeds {0}. the table has been cut. You can, change the maximum in the TXM > User preference page", MAX_NUMBER_OF_COLUMNS)); |
350 | 350 |
break; |
351 | 351 |
} |
TXM/trunk/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java (revision 3552) | ||
---|---|---|
534 | 534 |
for (int i = 0; i < colNames.length; i++) { |
535 | 535 |
|
536 | 536 |
if (i >= MAX_NUMBER_OF_COLUMNS) { |
537 |
Log.warning(NLS.bind("Warning The number of columns exceeds {0}. the table has been cut. You can, change the maximum in the TXM > User preference page", MAX_NUMBER_OF_COLUMNS));
|
|
537 |
Log.warning(NLS.bind("Warning The number of columns exceeds {0} ({1}). the table has been cut. You can, change the maximum in the TXM > User preference page", MAX_NUMBER_OF_COLUMNS, colNames.length));
|
|
538 | 538 |
break; |
539 | 539 |
} |
540 | 540 |
TableViewerColumn column = new TableViewerColumn(viewer, SWT.RIGHT); |
TXM/trunk/org.txm.backtomedia.rcp/src/org/txm/backtomedia/editors/player/HTMLPlayer.java (revision 3552) | ||
---|---|---|
12 | 12 |
import org.eclipse.swt.events.DisposeListener; |
13 | 13 |
import org.eclipse.swt.events.KeyEvent; |
14 | 14 |
import org.eclipse.swt.events.KeyListener; |
15 |
import org.eclipse.swt.events.MouseEvent; |
|
16 |
import org.eclipse.swt.events.MouseWheelListener; |
|
15 | 17 |
import org.eclipse.swt.events.SelectionEvent; |
16 | 18 |
import org.eclipse.swt.events.SelectionListener; |
17 | 19 |
import org.eclipse.swt.layout.GridData; |
... | ... | |
25 | 27 |
import org.txm.backtomedia.commands.function.OpenMediaPlayer; |
26 | 28 |
import org.txm.backtomedia.commands.function.SimpleFileDialog; |
27 | 29 |
import org.txm.backtomedia.preferences.BackToMediaPreferences; |
30 |
import org.txm.rcp.editors.TXMBrowserEditor; |
|
28 | 31 |
import org.txm.rcp.swt.GLComposite; |
29 | 32 |
|
30 | 33 |
public class HTMLPlayer extends Composite implements IPlayer { |
... | ... | |
63 | 66 |
browser = new Browser(this, SWT.NONE); |
64 | 67 |
browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); |
65 | 68 |
|
69 |
browser.addMouseWheelListener(new MouseWheelListener() { |
|
70 |
|
|
71 |
@Override |
|
72 |
public void mouseScrolled(MouseEvent e) { |
|
73 |
|
|
74 |
if ((e.stateMask & SWT.CTRL) == SWT.CTRL) { |
|
75 |
if (e.count > 0) { |
|
76 |
TXMBrowserEditor.zoomIn(browser); |
|
77 |
} else { |
|
78 |
TXMBrowserEditor.zoomOut(browser); |
|
79 |
} |
|
80 |
} |
|
81 |
} |
|
82 |
}); |
|
83 |
|
|
66 | 84 |
// use flex to center the video |
67 | 85 |
// use ondataload fix the video size depending on its ratio and the viewport height |
68 | 86 |
// diable the fullscreen button, use a CSS special rule for webkit |
Formats disponibles : Unified diff