Révision 1440
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java (revision 1440) | ||
---|---|---|
309 | 309 |
// FIXME: define here what to display |
310 | 310 |
String mess = ((TXMResult)selectedItem).getSimpleDetails(); |
311 | 311 |
if (mess == null) mess = selectedItem.toString(); |
312 |
|
|
313 | 312 |
StatusLine.setMessage(mess); |
314 | 313 |
} |
315 | 314 |
|
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1440) | ||
---|---|---|
144 | 144 |
/** |
145 | 145 |
* The SWT parent Composite. |
146 | 146 |
*/ |
147 |
private Composite parent;
|
|
147 |
protected Composite parent;
|
|
148 | 148 |
|
149 | 149 |
/** |
150 | 150 |
* contains the default bottom toolbars widget |
... | ... | |
402 | 402 |
if (this.bottomToolBar.getItems().length == 0) { |
403 | 403 |
this.bottomToolBar.dispose(); |
404 | 404 |
} |
405 |
|
|
405 |
|
|
406 | 406 |
// remove empty toolbar |
407 | 407 |
//TODO SJ: Hack? MD: yeah -> need to find a way to not display the bottom toolbar on Windows instead |
408 | 408 |
if (this.topToolBar.getItems().length == 0) { |
... | ... | |
417 | 417 |
|
418 | 418 |
// disable the compute button, it will be re-enable or not later when the UI will check if the editor is dirty or not |
419 | 419 |
ToolItem computeButton = this.topToolBar.getItemByContributionId(TOP_TOOLBAR_COMPUTE_BUTTON_ID); |
420 |
computeButton.setEnabled(false); |
|
421 |
|
|
420 |
if (computeButton != null) { |
|
421 |
computeButton.setEnabled(false); |
|
422 |
} |
|
422 | 423 |
|
423 | 424 |
} catch(Throwable e) { |
424 | 425 |
Log.severe(TXMCoreMessages.bind("TXMEditor.createPartControl(): can not create the editor for result {0}.", this.getResult())); //$NON-NLS-1$ |
... | ... | |
601 | 602 |
|
602 | 603 |
// enable/disable the compute button according to dirty state of the editor |
603 | 604 |
ToolItem computeButton = this.topToolBar.getItemByContributionId(TOP_TOOLBAR_COMPUTE_BUTTON_ID); //$NON-NLS-1$ |
604 |
computeButton.setEnabled(dirty); |
|
605 |
if (computeButton !=null) { |
|
606 |
computeButton.setEnabled(dirty); |
|
607 |
} |
|
605 | 608 |
|
606 | 609 |
|
607 | 610 |
// for(Control c : this.topToolBar.getChildren()) { |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java (revision 1440) | ||
---|---|---|
52 | 52 |
*/ |
53 | 53 |
private HashMap<String, ToolItem> buttons = new HashMap<String, ToolItem>(); |
54 | 54 |
|
55 |
private ToolBarManager manager; |
|
56 |
|
|
55 | 57 |
/** |
56 | 58 |
* |
57 | 59 |
* The parent layout must be a GridLayout. |
... | ... | |
68 | 70 |
this.editorPart = editor; |
69 | 71 |
this.subWidgetComposite = subWidgetComposite; |
70 | 72 |
// permit to contribute via RCP plugin.xml menu extension |
71 |
ToolBarManager manager = new ToolBarManager(this);
|
|
73 |
manager = new ToolBarManager(this); |
|
72 | 74 |
IMenuService menuService = (IMenuService) this.editorPart.getSite().getService(IMenuService.class); |
73 | 75 |
menuService.populateContributionManager(manager, "toolbar:" + toolbarId); //$NON-NLS-1$ |
74 | 76 |
} |
... | ... | |
77 | 79 |
protected void checkSubclass() { |
78 | 80 |
} |
79 | 81 |
|
82 |
public ToolBarManager getToolBarManager() { |
|
83 |
return manager; |
|
84 |
} |
|
85 |
|
|
80 | 86 |
/** |
81 | 87 |
* |
82 | 88 |
* @return the composite that contains the sub widgets of the toolbar : installed groups, composites. |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/StatusLine.java (revision 1440) | ||
---|---|---|
31 | 31 |
import java.util.TimerTask; |
32 | 32 |
|
33 | 33 |
import org.eclipse.jface.action.IStatusLineManager; |
34 |
import org.eclipse.swt.events.SelectionEvent; |
|
34 | 35 |
import org.eclipse.swt.widgets.Display; |
35 | 36 |
|
36 | 37 |
/** |
... | ... | |
57 | 58 |
StatusLine.statusLine = statusline; |
58 | 59 |
} |
59 | 60 |
|
61 |
static int MAX = 50; |
|
60 | 62 |
/** |
61 | 63 |
* Shows a message in the status line. |
62 | 64 |
* |
... | ... | |
66 | 68 |
Display.getDefault().syncExec(new Runnable() { |
67 | 69 |
@Override |
68 | 70 |
public void run() { |
69 |
if (statusLine != null) |
|
70 |
statusLine.setMessage(null, message); |
|
71 |
if (statusLine != null) { |
|
72 |
if (message.length() > MAX) { |
|
73 |
statusLine.setMessage(null, message.substring(0, MAX)+"..."); |
|
74 |
} else { |
|
75 |
statusLine.setMessage(null, message); |
|
76 |
} |
|
77 |
} |
|
71 | 78 |
} |
72 | 79 |
}); |
73 | 80 |
|
74 |
cancelTimer(); |
|
75 |
scheduleTimer(); |
|
81 |
//cancelTimer();
|
|
82 |
//scheduleTimer();
|
|
76 | 83 |
} |
77 | 84 |
|
78 | 85 |
/** |
... | ... | |
133 | 140 |
* Stops the timer |
134 | 141 |
*/ |
135 | 142 |
private static void cancelTimer() { |
136 |
if (!timerScheduled) |
|
137 |
return; |
|
138 |
timerScheduled = false; |
|
139 |
timer.cancel(); |
|
143 |
// if (!timerScheduled)
|
|
144 |
// return;
|
|
145 |
// timerScheduled = false;
|
|
146 |
// timer.cancel();
|
|
140 | 147 |
} |
141 | 148 |
|
142 | 149 |
/** |
143 | 150 |
* Starts the timer |
144 | 151 |
*/ |
145 | 152 |
private static void scheduleTimer() { |
146 |
if (timerScheduled) |
|
147 |
return; |
|
148 |
timerScheduled = true; |
|
149 |
timer = new Timer(); |
|
150 |
TimerTask timerTask = new TimerTask() { |
|
151 |
@Override |
|
152 |
public void run() { |
|
153 |
Runnable r = new Runnable() { |
|
154 |
@Override |
|
155 |
public void run() { |
|
156 |
StatusLine.setMessage(""); //$NON-NLS-1$ |
|
157 |
} |
|
158 |
}; |
|
159 |
Display.getDefault().syncExec(r); |
|
160 |
} |
|
161 |
}; |
|
162 |
timer.schedule(timerTask, time); |
|
153 |
// if (timerScheduled)
|
|
154 |
// return;
|
|
155 |
// timerScheduled = true;
|
|
156 |
// timer = new Timer();
|
|
157 |
// TimerTask timerTask = new TimerTask() {
|
|
158 |
// @Override
|
|
159 |
// public void run() {
|
|
160 |
// Runnable r = new Runnable() {
|
|
161 |
// @Override
|
|
162 |
// public void run() {
|
|
163 |
// StatusLine.setMessage(""); //$NON-NLS-1$
|
|
164 |
// }
|
|
165 |
// };
|
|
166 |
// Display.getDefault().syncExec(r);
|
|
167 |
// }
|
|
168 |
// };
|
|
169 |
// timer.schedule(timerTask, time);
|
|
163 | 170 |
} |
164 | 171 |
} |
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 1440) | ||
---|---|---|
1914 | 1914 |
public final String getSimpleDetails() { |
1915 | 1915 |
String mess = this.getDetails(); |
1916 | 1916 |
if (mess != null) |
1917 |
return mess.replace("\n", " "); |
|
1917 |
return mess.replace("\n", " ").replace("\t", " ");
|
|
1918 | 1918 |
|
1919 | 1919 |
return this.toString(); |
1920 | 1920 |
} |
Formats disponibles : Unified diff