Révision 508
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java (revision 508) | ||
|---|---|---|
| 1 | 1 |
package org.txm.rcp.editors; |
| 2 | 2 |
|
| 3 |
import java.util.HashMap; |
|
| 4 |
|
|
| 3 | 5 |
import org.eclipse.jface.action.ToolBarManager; |
| 6 |
import org.eclipse.swt.SWT; |
|
| 7 |
import org.eclipse.swt.events.SelectionEvent; |
|
| 8 |
import org.eclipse.swt.events.SelectionListener; |
|
| 9 |
import org.eclipse.swt.layout.GridData; |
|
| 10 |
import org.eclipse.swt.layout.GridLayout; |
|
| 11 |
import org.eclipse.swt.layout.RowLayout; |
|
| 4 | 12 |
import org.eclipse.swt.widgets.Composite; |
| 13 |
import org.eclipse.swt.widgets.Group; |
|
| 5 | 14 |
import org.eclipse.swt.widgets.ToolBar; |
| 15 |
import org.eclipse.swt.widgets.ToolItem; |
|
| 6 | 16 |
import org.eclipse.ui.menus.IMenuService; |
| 17 |
import org.txm.rcp.IImageKeys; |
|
| 7 | 18 |
|
| 8 | 19 |
/** |
| 9 | 20 |
* |
| 10 |
* The default TXM result editor tool bar shared by every <code>TXMEditorPart</code>. |
|
| 11 |
* The tool bar is accessible and usable in plugin.xml with the 'toolbar:TXMEditorToolBar' URI. |
|
| 21 |
* The default TXM result editor tool bar shared by every <code>TXMEditorPart</code> used to open/close a parameter panel. |
|
| 12 | 22 |
* |
| 23 |
* The tool bar is accessible and usable in plugin.xml with the 'toolbar:toolbar_local_id' URI specified in the constructor. |
|
| 24 |
* |
|
| 13 | 25 |
* @author sjacquot |
| 14 | 26 |
* |
| 15 | 27 |
*/ |
| 16 | 28 |
public class TXMEditorToolBar extends ToolBar {
|
| 17 | 29 |
|
| 18 |
|
|
| 19 | 30 |
/** |
| 20 | 31 |
* The linked <code>TXMEditorPart</code>. |
| 21 | 32 |
*/ |
| 22 | 33 |
protected TXMEditorPart editorPart; |
| 34 |
|
|
| 35 |
private HashMap<String, Group> groups = new HashMap<String, Group>(); |
|
| 23 | 36 |
|
| 37 |
private Composite parametersGroupsComposite; |
|
| 24 | 38 |
|
| 25 |
|
|
| 26 |
/** |
|
| 27 |
* |
|
| 28 |
* @param parent |
|
| 29 |
* @param style |
|
| 30 |
* @param resultEditorPart |
|
| 31 |
*/ |
|
| 32 |
public TXMEditorToolBar(Composite parent, int style, TXMEditorPart resultEditorPart) {
|
|
| 33 |
this(parent, style, "TXMEditorToolBar", resultEditorPart); //$NON-NLS-1$ |
|
| 34 |
} |
|
| 35 |
|
|
| 36 | 39 |
|
| 37 | 40 |
/** |
| 38 | 41 |
* |
| 42 |
* the parent layout must be a GridLayout |
|
| 43 |
* |
|
| 39 | 44 |
* @param parent |
| 40 | 45 |
* @param style |
| 41 |
* @param toolBarId
|
|
| 46 |
* @param toolbar_local_id
|
|
| 42 | 47 |
* @param resultEditorPart |
| 43 | 48 |
*/ |
| 44 |
protected TXMEditorToolBar(Composite parent, int style, String toolBarId, TXMEditorPart resultEditorPart) {
|
|
| 49 |
public TXMEditorToolBar(Composite parent, int style, String toolbar_local_id, TXMEditorPart resultEditorPart) {
|
|
| 45 | 50 |
super(parent, style); |
| 46 | 51 |
|
| 47 | 52 |
this.editorPart = resultEditorPart; |
| ... | ... | |
| 49 | 54 |
// permit to contribute via plugin.xml menu extension |
| 50 | 55 |
ToolBarManager manager = new ToolBarManager(this); |
| 51 | 56 |
IMenuService menuService = (IMenuService) this.editorPart.getSite().getService(IMenuService.class); |
| 52 |
menuService.populateContributionManager(manager, "toolbar:" + toolBarId); //$NON-NLS-1$ |
|
| 57 |
menuService.populateContributionManager(manager, "toolbar:" + toolbar_local_id); //$NON-NLS-1$ |
|
| 58 |
|
|
| 59 |
parametersGroupsComposite = new Composite(parent, SWT.NONE); |
|
| 60 |
GridLayout gl = new GridLayout(1, true); |
|
| 61 |
gl.marginBottom = gl.marginHeight = gl.marginWidth = gl.marginTop = 0; |
|
| 62 |
parametersGroupsComposite.setLayout(gl); |
|
| 63 |
if (parent.getLayout() instanceof GridLayout) |
|
| 64 |
parametersGroupsComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); |
|
| 65 |
|
|
| 53 | 66 |
} |
| 54 | 67 |
|
| 55 |
|
|
| 56 | 68 |
@Override |
| 57 | 69 |
protected void checkSubclass() {
|
| 58 | 70 |
} |
| ... | ... | |
| 65 | 77 |
return editorPart; |
| 66 | 78 |
} |
| 67 | 79 |
|
| 80 |
/** |
|
| 81 |
* Sets the visibility state of the specified composite. |
|
| 82 |
* The mechanism is based on GridData.exclude to hide the composite therefore the composite must have a GridData as layout data. |
|
| 83 |
* |
|
| 84 |
* @param composite |
|
| 85 |
* |
|
| 86 |
*/ |
|
| 87 |
public void setVisible(Composite composite, boolean visible) {
|
|
| 88 |
((GridData)composite.getLayoutData()).exclude = !visible; |
|
| 89 |
composite.setVisible(visible); |
|
| 90 |
composite.layout(true); |
|
| 91 |
editorPart.parent.layout(true); |
|
| 92 |
} |
|
| 93 |
|
|
| 94 |
/** |
|
| 95 |
* Creates a <code>Group</code> with some configuration to make it visible/invisible and a <code>ToolItem</code> attached to the specified tool bar to show/hide this group. |
|
| 96 |
* |
|
| 97 |
* @param composite |
|
| 98 |
* @param colSpan |
|
| 99 |
* @param toolBar |
|
| 100 |
* @param groupTitle |
|
| 101 |
* @param buttonToolTip |
|
| 102 |
* @param iconFilePath |
|
| 103 |
* @return |
|
| 104 |
*/ |
|
| 105 |
public Group installGroup(String groupTitle, String buttonToolTip, String iconFilePath) {
|
|
| 106 |
|
|
| 107 |
|
|
| 108 |
|
|
| 109 |
if (groups.containsKey(groupTitle)) {
|
|
| 110 |
return groups.get(groupTitle); |
|
| 111 |
} |
|
| 112 |
|
|
| 113 |
final Group group = new Group(parametersGroupsComposite, SWT.NONE); |
|
| 114 |
group.setText(groupTitle); |
|
| 115 |
|
|
| 116 |
RowLayout layout = new RowLayout(); |
|
| 117 |
layout.wrap = true; |
|
| 118 |
layout.center = true; |
|
| 119 |
layout.marginWidth = layout.marginBottom = layout.marginHeight = layout.marginTop = 0; |
|
| 120 |
group.setLayout(layout); |
|
| 121 |
|
|
| 122 |
GridData gd2 = new GridData(GridData.FILL_BOTH); |
|
| 123 |
gd2.grabExcessVerticalSpace = false; |
|
| 124 |
gd2.grabExcessHorizontalSpace = true; |
|
| 125 |
gd2.exclude = true; |
|
| 126 |
group.setLayoutData(gd2); |
|
| 127 |
group.setVisible(false); |
|
| 128 |
|
|
| 129 |
|
|
| 130 |
// add finally a button to the toolbar to show/hide the Group |
|
| 131 |
final ToolItem showParameters = new ToolItem(this, SWT.CHECK | SWT.LEFT); |
|
| 132 |
|
|
| 133 |
if (iconFilePath != null) |
|
| 134 |
showParameters.setImage(IImageKeys.getImage(iconFilePath)); |
|
| 135 |
else // if no icon specified, show the group title in the toolitem |
|
| 136 |
showParameters.setText(groupTitle); |
|
| 137 |
|
|
| 138 |
if (buttonToolTip != null) |
|
| 139 |
showParameters.setToolTipText(buttonToolTip); |
|
| 140 |
|
|
| 141 |
showParameters.setSelection(false); |
|
| 142 |
|
|
| 143 |
showParameters.addSelectionListener(new SelectionListener() {
|
|
| 144 |
|
|
| 145 |
@Override |
|
| 146 |
public void widgetSelected(SelectionEvent e) {
|
|
| 147 |
setVisible(group, showParameters.getSelection()); |
|
| 148 |
} |
|
| 149 |
|
|
| 150 |
@Override |
|
| 151 |
public void widgetDefaultSelected(SelectionEvent e) { }
|
|
| 152 |
}); |
|
| 153 |
|
|
| 154 |
groups.put(groupTitle, group); |
|
| 155 |
return group; |
|
| 156 |
} |
|
| 68 | 157 |
} |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorPart.java (revision 508) | ||
|---|---|---|
| 3 | 3 |
*/ |
| 4 | 4 |
package org.txm.rcp.editors; |
| 5 | 5 |
|
| 6 |
import java.util.HashMap; |
|
| 7 |
|
|
| 6 | 8 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 7 | 9 |
import org.eclipse.core.runtime.IStatus; |
| 8 | 10 |
import org.eclipse.core.runtime.Status; |
| ... | ... | |
| 33 | 35 |
import org.txm.utils.logger.Log; |
| 34 | 36 |
|
| 35 | 37 |
/** |
| 36 |
* Base TXM result <code>EditorPart</code>. |
|
| 38 |
* Base TXM result <code>EditorPart</code> composed of |
|
| 39 |
* - a main toolbar at the top |
|
| 40 |
* - display area |
|
| 41 |
* - a bottom toolbar at the bottom of the ditor |
|
| 37 | 42 |
* |
| 38 | 43 |
* @author sjacquot |
| 39 | 44 |
* |
| ... | ... | |
| 41 | 46 |
public abstract class TXMEditorPart extends EditorPart {
|
| 42 | 47 |
|
| 43 | 48 |
/** |
| 44 |
* The editor tool bar.
|
|
| 49 |
* The editor main tool bar, positioned at the top of the editor.
|
|
| 45 | 50 |
*/ |
| 46 |
protected TXMEditorToolBar toolBar; |
|
| 51 |
protected TXMEditorToolBar topToolBar;
|
|
| 47 | 52 |
|
| 53 |
protected Composite displayArea; |
|
| 54 |
|
|
| 48 | 55 |
/** |
| 49 |
* The command parameters composite that can be hidden.
|
|
| 56 |
* The editor bottom tool bar, positioned at the bottom of the editor.
|
|
| 50 | 57 |
*/ |
| 51 |
protected Composite commandParametersComposite;
|
|
| 52 |
|
|
| 58 |
protected TXMEditorToolBar bottomToolBar;
|
|
| 59 |
|
|
| 53 | 60 |
/** |
| 54 |
* The command parameters group.
|
|
| 61 |
* the parameters groups are added to this composite
|
|
| 55 | 62 |
*/ |
| 56 |
protected Group commandParametersGroup;
|
|
| 63 |
private Composite parametersGroupsComposite;
|
|
| 57 | 64 |
|
| 65 |
/** |
|
| 66 |
* The command parameters composite that can be hidden. To add main parameters. |
|
| 67 |
*/ |
|
| 68 |
protected Composite computingParametersGroup; |
|
| 69 |
|
|
| 70 |
Composite parent; |
|
| 71 |
|
|
| 72 |
private Composite topToolBarContainer; |
|
| 73 |
|
|
| 58 | 74 |
@Override |
| 59 | 75 |
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
|
| 60 | 76 |
this.setSite(site); |
| ... | ... | |
| 72 | 88 |
@Override |
| 73 | 89 |
public void createPartControl(Composite parent) {
|
| 74 | 90 |
|
| 91 |
this.parent = parent; |
|
| 92 |
|
|
| 75 | 93 |
// to hide and display the command parameters composite |
| 76 | 94 |
this.initParentLayout(parent, 1); |
| 77 | 95 |
|
| 78 |
// tool bar |
|
| 79 |
this.toolBar = new TXMEditorToolBar(parent, SWT.FLAT, this); |
|
| 96 |
// create the top tool bar |
|
| 97 |
topToolBarContainer = new Composite(parent, SWT.NONE); |
|
| 98 |
topToolBarContainer.setLayoutData(new GridData(GridData.FILL,GridData.FILL,true, false)); |
|
| 80 | 99 |
|
| 81 |
// command parameters composite
|
|
| 82 |
this.commandParametersComposite = new Composite(parent, SWT.NONE);
|
|
| 83 |
this.commandParametersGroup = this.initCommandParametersGroup(1);
|
|
| 100 |
RowLayout rl = new RowLayout(SWT.HORIZONTAL);
|
|
| 101 |
rl.marginTop = rl.marginHeight = rl.marginWidth = rl.marginBottom = 0;
|
|
| 102 |
topToolBarContainer.setLayout(rl);
|
|
| 84 | 103 |
|
| 85 |
// show the command parameters if the result is not yet computed |
|
| 86 |
this.setVisible(this.commandParametersComposite, this.getEditorInput().getResult().isDirty()); |
|
| 104 |
this.topToolBar = new TXMEditorToolBar(topToolBarContainer, SWT.FLAT | SWT.RIGHT, "top", this); |
|
| 87 | 105 |
|
| 88 |
this.commandParametersGroup.pack(); |
|
| 106 |
computingParametersGroup = topToolBar.installGroup("Computing parameters", "Show/Hide command parameters", "icons/show_computing_parameters.png");
|
|
| 107 |
|
|
| 108 |
displayArea = new Composite(parent, SWT.NONE); |
|
| 109 |
displayArea.setLayoutData(new GridData(GridData.FILL_BOTH)); |
|
| 110 |
|
|
| 111 |
// bottom tool bar |
|
| 112 |
this.bottomToolBar = new TXMEditorToolBar(parent, SWT.FLAT, "bottom", this); |
|
| 89 | 113 |
} |
| 90 |
|
|
| 91 |
/** |
|
| 92 |
* Creates the command parameters group with some configuration to make it visible/invisible. |
|
| 93 |
* |
|
| 94 |
* @param colSpan |
|
| 95 |
* @return |
|
| 96 |
*/ |
|
| 97 |
public Group initCommandParametersGroup(int colSpan) {
|
|
| 98 |
return this.initGroup(this.commandParametersComposite, colSpan, this.toolBar, "Computing parameters", "Show/Hide command parameters", "icons/show_computing_parameters.png"); |
|
| 114 |
|
|
| 115 |
public Composite getTopToolBarContainer() {
|
|
| 116 |
return topToolBarContainer; |
|
| 99 | 117 |
} |
| 100 | 118 |
|
| 101 |
/** |
|
| 102 |
* Creates a <code>Group</code> with some configuration to make it visible/invisible and a <code>ToolItem</code> attached to the specified tool bar to show/hide this group. |
|
| 103 |
* |
|
| 104 |
* @param composite |
|
| 105 |
* @param colSpan |
|
| 106 |
* @param toolBar |
|
| 107 |
* @param groupTitle |
|
| 108 |
* @param buttonToolTip |
|
| 109 |
* @param iconFilePath |
|
| 110 |
* @return |
|
| 111 |
*/ |
|
| 112 |
public Group initGroup(final Composite composite, int colSpan, TXMEditorToolBar toolBar, String groupTitle, String buttonToolTip, String iconFilePath) {
|
|
| 119 |
public void getComputingParametersGroup() {
|
|
| 113 | 120 |
|
| 114 |
final Group group = new Group(composite, SWT.NONE); |
|
| 115 |
group.setText(groupTitle); |
|
| 116 |
|
|
| 117 |
RowLayout layout = new RowLayout(); |
|
| 118 |
layout.wrap = true; |
|
| 119 |
layout.center = true; |
|
| 120 |
group.setLayout(layout); |
|
| 121 |
|
|
| 122 |
composite.setLayout(new GridLayout(1, true)); |
|
| 123 |
group.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); |
|
| 124 |
|
|
| 125 |
GridData gd2 = new GridData(GridData.FILL_BOTH);; |
|
| 126 |
gd2.grabExcessVerticalSpace = false; |
|
| 127 |
gd2.grabExcessHorizontalSpace = true; |
|
| 128 |
gd2.horizontalSpan = colSpan; |
|
| 129 |
gd2.exclude = true; |
|
| 130 |
composite.setLayoutData(gd2); |
|
| 131 |
composite.setVisible(false); |
|
| 132 |
|
|
| 133 |
// add button to the tool bar to show/hide parameters |
|
| 134 |
final ToolItem showParameters = new ToolItem(toolBar, SWT.CHECK); |
|
| 135 |
showParameters.setImage(IImageKeys.getImage(toolBar.getClass(), iconFilePath)); |
|
| 136 |
showParameters.setToolTipText(buttonToolTip); |
|
| 137 |
showParameters.setSelection(false); |
|
| 138 |
|
|
| 139 |
showParameters.addSelectionListener(new SelectionListener() {
|
|
| 140 |
|
|
| 141 |
@Override |
|
| 142 |
public void widgetSelected(SelectionEvent e) {
|
|
| 143 |
setVisible(composite, showParameters.getSelection()); |
|
| 144 |
} |
|
| 145 |
|
|
| 146 |
@Override |
|
| 147 |
public void widgetDefaultSelected(SelectionEvent e) {
|
|
| 148 |
// TODO Auto-generated method stub |
|
| 149 |
} |
|
| 150 |
}); |
|
| 151 |
|
|
| 152 |
return group; |
|
| 153 | 121 |
} |
| 154 | 122 |
|
| 123 |
public TXMEditorToolBar getTopToolbar() {
|
|
| 124 |
return topToolBar; |
|
| 125 |
} |
|
| 126 |
|
|
| 155 | 127 |
/** |
| 156 |
* Sets the visibility state of the specified composite. |
|
| 157 |
* The mechanism is based on GridData.exclude to hide the composite therefore the composite must have a GridData as layout data. |
|
| 158 |
* |
|
| 159 |
* @param composite |
|
| 128 |
* The user must configure its layout |
|
| 129 |
* @return |
|
| 160 | 130 |
*/ |
| 161 |
public void setVisible(Composite composite, boolean visible) {
|
|
| 162 |
((GridData)composite.getLayoutData()).exclude = !visible; |
|
| 163 |
composite.setVisible(visible); |
|
| 164 |
composite.getParent().layout(true); |
|
| 131 |
public Composite getDisplayArea() {
|
|
| 132 |
return displayArea; |
|
| 165 | 133 |
} |
| 166 |
|
|
| 134 |
|
|
| 135 |
public TXMEditorToolBar getBottomToolbar() {
|
|
| 136 |
return bottomToolBar; |
|
| 137 |
} |
|
| 138 |
|
|
| 167 | 139 |
/** |
| 168 | 140 |
* Crates the parent layout with some configuration to make children composite visible/invisible. |
| 169 | 141 |
* |
| ... | ... | |
| 171 | 143 |
*/ |
| 172 | 144 |
public void initParentLayout(Composite parent, int colSpan) {
|
| 173 | 145 |
GridLayout gl = new GridLayout(); |
| 174 |
gl.marginTop = 5;
|
|
| 146 |
gl.marginTop = 0;
|
|
| 175 | 147 |
gl.marginHeight = 0; |
| 176 | 148 |
gl.marginWidth = 0; |
| 149 |
gl.marginBottom = 0; |
|
| 177 | 150 |
gl.numColumns = colSpan; |
| 178 | 151 |
parent.setLayout(gl); |
| 179 | 152 |
} |
| 180 | 153 |
|
| 181 | 154 |
/** |
| 182 |
* @return the commandParametersGroup |
|
| 183 |
*/ |
|
| 184 |
public Group getCommandParametersGroup() {
|
|
| 185 |
return commandParametersGroup; |
|
| 186 |
} |
|
| 187 |
|
|
| 188 |
/** |
|
| 189 | 155 |
* @return the commandParametersComposite |
| 190 | 156 |
*/ |
| 191 |
public Composite getCommandParametersComposite() {
|
|
| 192 |
return commandParametersComposite;
|
|
| 157 |
public Composite getCommandParametersGroup() {
|
|
| 158 |
return computingParametersGroup;
|
|
| 193 | 159 |
} |
| 194 | 160 |
|
| 195 | 161 |
@Override |
| ... | ... | |
| 308 | 274 |
final TXMParameters parameters = null;//this.getParameters(); |
| 309 | 275 |
final String title = result.getName()+"..."; |
| 310 | 276 |
try {
|
| 311 |
JobHandler jobhandler = new JobHandler(title, toolBar) {
|
|
| 277 |
JobHandler jobhandler = new JobHandler(title, topToolBar) {
|
|
| 312 | 278 |
@Override |
| 313 | 279 |
protected IStatus run(IProgressMonitor monitor) {
|
| 314 | 280 |
this.runInit(monitor); |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/base/DeleteObject.java (revision 508) | ||
|---|---|---|
| 141 | 141 |
|
| 142 | 142 |
/** |
| 143 | 143 |
* Delete. |
| 144 |
* |
|
| 145 |
* TODO: select the parent object of the deleted object |
|
| 144 | 146 |
* |
| 145 | 147 |
* @param objects the objects to delete |
| 146 | 148 |
* @return |
| tmp/org.txm.annotation.rcp/src/org/txm/annoation/rcp/concordance/AnnotationButton.java (revision 508) | ||
|---|---|---|
| 1 |
package org.txm.annoation.rcp.concordance; |
|
| 2 |
|
|
| 3 |
import org.txm.concordance.rcp.editors.ConcordanceEditor; |
|
| 4 |
import org.txm.concordance.rcp.editors.ConcordanceEditorButton; |
|
| 5 |
|
|
| 6 |
public class AnnotationButton extends ConcordanceEditorButton {
|
|
| 7 |
|
|
| 8 |
public AnnotationButton(ConcordanceEditor editor) {
|
|
| 9 |
super(editor); |
|
| 10 |
} |
|
| 11 |
|
|
| 12 |
@Override |
|
| 13 |
public String getName() {
|
|
| 14 |
return "Annotation"; |
|
| 15 |
} |
|
| 16 |
|
|
| 17 |
@Override |
|
| 18 |
public boolean install() {
|
|
| 19 |
// TODO Auto-generated method stub |
|
| 20 |
return false; |
|
| 21 |
} |
|
| 22 |
} |
|
| 0 | 23 | |
| tmp/org.txm.annotation.rcp/plugin.xml (revision 508) | ||
|---|---|---|
| 308 | 308 |
</with> |
| 309 | 309 |
</definition> |
| 310 | 310 |
</extension> |
| 311 |
<extension |
|
| 312 |
point="org.txm.concordance.rcp.concordanceeditor.button"> |
|
| 313 |
<button |
|
| 314 |
class="org.txm.annoation.rcp.concordance.AnnotationButton" |
|
| 315 |
name="Annotation"> |
|
| 316 |
</button> |
|
| 317 |
</extension> |
|
| 311 | 318 |
</plugin> |
| tmp/org.txm.annotation.rcp/META-INF/MANIFEST.MF (revision 508) | ||
|---|---|---|
| 9 | 9 |
org.eclipse.core.commands, |
| 10 | 10 |
org.eclipse.jface, |
| 11 | 11 |
org.eclipse.ui.workbench;visibility:=reexport, |
| 12 |
org.txm.rcp;bundle-version="0.8.0";visibility:=reexport |
|
| 13 |
Export-Package: org.txm.annotation.rcp.commands, |
|
| 12 |
org.txm.rcp;bundle-version="0.8.0";visibility:=reexport, |
|
| 13 |
org.txm.concordance.core;bundle-version="1.0.0", |
|
| 14 |
org.txm.concordance.rcp;bundle-version="1.0.0" |
|
| 15 |
Export-Package: org.txm.annoation.rcp.concordance, |
|
| 16 |
org.txm.annotation.rcp.commands, |
|
| 14 | 17 |
org.txm.annotation.rcp.commands.krview, |
| 18 |
org.txm.annotation.rcp.editors.imports.sections, |
|
| 19 |
org.txm.annotation.rcp.preferences, |
|
| 15 | 20 |
org.txm.annotation.rcp.views.knowledgerepositories, |
| 16 | 21 |
org.txm.rcp.tests |
| tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/SWTChartsComponentsProvider.java (revision 508) | ||
|---|---|---|
| 31 | 31 |
import org.eclipse.swt.widgets.TabItem; |
| 32 | 32 |
import org.eclipse.swt.widgets.ToolBar; |
| 33 | 33 |
import org.eclipse.swt.widgets.ToolItem; |
| 34 |
import org.eclipse.swt.widgets.Widget; |
|
| 34 | 35 |
import org.eclipse.ui.IWorkbenchPage; |
| 35 | 36 |
import org.eclipse.ui.IWorkbenchWindow; |
| 36 | 37 |
import org.eclipse.ui.PartInitException; |
| ... | ... | |
| 813 | 814 |
public static ChartEditorPart getActiveChartEditor(ExecutionEvent event) {
|
| 814 | 815 |
ChartEditorPart chartEditor = null; |
| 815 | 816 |
|
| 817 |
Event eevent = (Event)event.getTrigger(); |
|
| 818 |
Widget widget = eevent.widget; |
|
| 816 | 819 |
// Toolbars |
| 817 |
if(event != null && ((Event)event.getTrigger()).widget instanceof ToolItem) {
|
|
| 818 |
if(((ToolItem)((Event)event.getTrigger()).widget).getParent() instanceof ChartEditorToolBar) {
|
|
| 820 |
if(event != null && widget instanceof ToolItem) {
|
|
| 821 |
ToolItem to = (ToolItem) widget; |
|
| 822 |
ToolBar parent = to.getParent(); |
|
| 823 |
if(to.getParent() instanceof ChartEditorToolBar) {
|
|
| 819 | 824 |
chartEditor = ((ChartEditorToolBar)((ToolItem)((Event)event.getTrigger()).widget).getParent()).getEditorPart(); |
| 820 | 825 |
} |
| 821 |
if(((ToolItem)((Event)event.getTrigger()).widget).getParent() instanceof AdvancedChartEditorToolBar) {
|
|
| 826 |
if(to.getParent() instanceof AdvancedChartEditorToolBar) {
|
|
| 822 | 827 |
chartEditor = ((AdvancedChartEditorToolBar)((ToolItem)((Event)event.getTrigger()).widget).getParent()).getEditorPart(); |
| 823 | 828 |
} |
| 824 | 829 |
} |
| tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditorPart.java (revision 508) | ||
|---|---|---|
| 129 | 129 |
|
| 130 | 130 |
@Override |
| 131 | 131 |
public void createPartControl(Composite parent) {
|
| 132 |
|
|
| 133 |
// to hide and display the command and rendering parameters composite |
|
| 134 |
this.initParentLayout(parent, 2); |
|
| 132 |
super.createPartControl(parent); |
|
| 135 | 133 |
|
| 136 |
this.toolBar = new TXMEditorToolBar(parent, SWT.FLAT, this); |
|
| 134 |
// // to hide and display the command and rendering parameters composite |
|
| 135 |
// this.initParentLayout(parent, 2); |
|
| 136 |
// |
|
| 137 |
// this.topToolBar = new TXMEditorToolBar(parent, SWT.FLAT, "top", this); |
|
| 138 |
// |
|
| 139 |
// |
|
| 140 |
// GridData gd2 = new GridData(); |
|
| 141 |
// gd2.grabExcessHorizontalSpace = false; |
|
| 142 |
// this.topToolBar.setLayoutData(gd2); |
|
| 143 |
// //this.toolBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); |
|
| 144 |
// |
|
| 137 | 145 |
|
| 138 |
|
|
| 139 |
GridData gd2 = new GridData(); |
|
| 140 |
gd2.grabExcessHorizontalSpace = false; |
|
| 141 |
this.toolBar.setLayoutData(gd2); |
|
| 142 |
//this.toolBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); |
|
| 143 |
|
|
| 144 |
|
|
| 145 | 146 |
// Toolbar |
| 146 |
this.chartToolBar = new ChartEditorToolBar(parent, SWT.FLAT, this);
|
|
| 147 |
this.chartToolBar = new ChartEditorToolBar(this.getTopToolBarContainer(), SWT.FLAT | SWT.RIGHT, this);
|
|
| 147 | 148 |
//this.chartToolBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_RED)); |
| 148 | 149 |
|
| 149 | 150 |
|
| 150 | 151 |
// Tests with groups instead of tabs |
| 151 | 152 |
// FIXME: command parameters composite |
| 152 |
this.commandParametersComposite = new Composite(parent, SWT.NONE);
|
|
| 153 |
this.commandParametersGroup = this.initCommandParametersGroup(2); |
|
| 154 |
this.commandParametersGroup.pack(); |
|
| 153 |
// this.computingParametersGroup = new Composite(parent, SWT.NONE);
|
|
| 154 |
// this.commandParametersGroup = this.initCommandParametersGroup(2);
|
|
| 155 |
// this.commandParametersGroup.pack();
|
|
| 155 | 156 |
|
| 156 | 157 |
|
| 157 | 158 |
// // FIXME: Tab folder tests |
| ... | ... | |
| 220 | 221 |
|
| 221 | 222 |
//new ToolItem(this.chartToolBar, SWT.SEPARATOR); |
| 222 | 223 |
|
| 223 |
|
|
| 224 | 224 |
// Advanced tool bar |
| 225 |
this.advancedToolBarComposite = new Composite(parent, SWT.NONE); |
|
| 226 |
Group group = this.initGroup(this.advancedToolBarComposite, 2, this.chartToolBar, "Rendering parameters", "Show/Hide rendering parameters", "icons/show_rendering_parameters.png");
|
|
| 225 |
//this.advancedToolBarComposite = new Composite(parent, SWT.NONE);
|
|
| 226 |
Group group = this.topToolBar.installGroup("Rendering parameters", "Show/Hide rendering parameters", "platform:/plugin/org.txm.chartsengine.rcp/icons/show_rendering_parameters.png");
|
|
| 227 | 227 |
this.advancedChartToolBar = new AdvancedChartEditorToolBar(group, SWT.FLAT, this); |
| 228 | 228 |
// this.advancedToolBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); |
| 229 |
this.advancedToolBarComposite.pack(true); |
|
| 230 |
group.pack(true); |
|
| 231 |
this.advancedChartToolBar.pack(true); |
|
| 229 |
// this.advancedToolBarComposite.pack(true); |
|
| 232 | 230 |
|
| 233 |
|
|
| 234 | 231 |
// Chart composite |
| 235 | 232 |
ChartComposite chartComposite = this.getSWTChartsComponentsProvider().createComposite(this, parent); |
| 236 | 233 |
GridData gd = new GridData(GridData.FILL_BOTH); |
| 237 |
gd.grabExcessVerticalSpace = true; |
|
| 238 |
gd.grabExcessHorizontalSpace = true; |
|
| 239 |
gd.horizontalSpan = 2; // 2 for match the command parameters toolbar AND the chart toolbar |
|
| 234 |
// gd.grabExcessVerticalSpace = true;
|
|
| 235 |
// gd.grabExcessHorizontalSpace = true;
|
|
| 236 |
// gd.horizontalSpan = 2; // 2 for match the command parameters toolbar AND the chart toolbar
|
|
| 240 | 237 |
chartComposite.setLayoutData(gd); |
| 241 | 238 |
|
| 242 | 239 |
// FIXME: open dialog box message if the composite doesn't contain any chart (typically when the charts engine doesn't contain chart creator for the specified result data type) |
| tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/swt/AdvancedChartEditorToolBar.java (revision 508) | ||
|---|---|---|
| 8 | 8 |
import org.eclipse.swt.events.SelectionListener; |
| 9 | 9 |
import org.eclipse.swt.widgets.Combo; |
| 10 | 10 |
import org.eclipse.swt.widgets.Composite; |
| 11 |
import org.eclipse.swt.widgets.ToolBar; |
|
| 11 | 12 |
import org.eclipse.swt.widgets.ToolItem; |
| 12 | 13 |
import org.txm.chartsengine.core.ChartsEngine; |
| 13 | 14 |
import org.txm.chartsengine.core.preferences.ChartsEnginePreferences; |
| ... | ... | |
| 23 | 24 |
* @author sjacquot |
| 24 | 25 |
* |
| 25 | 26 |
*/ |
| 26 |
public class AdvancedChartEditorToolBar extends ChartEditorToolBar {
|
|
| 27 |
public class AdvancedChartEditorToolBar extends ToolBar {
|
|
| 27 | 28 |
|
| 29 |
private ChartEditorPart chartEditorPart; |
|
| 30 |
|
|
| 31 |
public ChartEditorPart getEditorPart() {
|
|
| 32 |
return chartEditorPart; |
|
| 33 |
} |
|
| 28 | 34 |
|
| 35 |
@Override |
|
| 36 |
protected void checkSubclass() { } // if this method is not defined then te ToolBar cannot be subclassed
|
|
| 37 |
|
|
| 29 | 38 |
/** |
| 30 | 39 |
* |
| 31 | 40 |
* @param parent |
| 32 | 41 |
* @param style |
| 33 | 42 |
*/ |
| 34 | 43 |
public AdvancedChartEditorToolBar(Composite parent, int style, final ChartEditorPart chartEditorPart) {
|
| 35 |
super(parent, style, "AdvancedChartEditorToolBar", chartEditorPart); //$NON-NLS-1$ |
|
| 36 |
|
|
| 44 |
super(parent, style); //$NON-NLS-1$ |
|
| 45 |
|
|
| 46 |
this.chartEditorPart = chartEditorPart; |
|
| 37 | 47 |
// FIXME: tests |
| 38 | 48 |
//this.setLayout(new FormLayout()); |
| 39 | 49 |
//this.setLayout(new GridLayout()); |
| tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 508) | ||
|---|---|---|
| 155 | 155 |
this.parameters.put(ConcordancePreferences.VIEW_REFERENCEPATTERN, ref); |
| 156 | 156 |
this.parameters.put(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN, ref); |
| 157 | 157 |
} else {
|
| 158 |
this.parameters.put(ConcordancePreferences.VIEW_REFERENCEPATTERN, "text"); |
|
| 159 |
this.parameters.put(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN, "text"); |
|
| 158 |
this.parameters.put(ConcordancePreferences.VIEW_REFERENCEPATTERN, "text_id");
|
|
| 159 |
this.parameters.put(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN, "text_id");
|
|
| 160 | 160 |
} |
| 161 | 161 |
|
| 162 | 162 |
this.setParameters(this.parameters); |
| tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java (revision 508) | ||
|---|---|---|
| 1343 | 1343 |
rPackagesPath = rPackagesPath.replace("\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$
|
| 1344 | 1344 |
} |
| 1345 | 1345 |
|
| 1346 |
|
|
| 1347 | 1346 |
// set proxy configuration using detected system proxy if exists |
| 1348 | 1347 |
SystemProxyDetector conf = new SystemProxyDetector(); |
| 1349 | 1348 |
this.initializeRWorkspaceConnectionConfiguration(conf); |
| tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java (revision 508) | ||
|---|---|---|
| 376 | 376 |
public void createPartControl(Composite parent) {
|
| 377 | 377 |
super.createPartControl(parent); |
| 378 | 378 |
|
| 379 |
//TODO: hack until the parameter area is fully designed |
|
| 380 |
parent = new Composite(parent, SWT.NONE); |
|
| 381 |
FormLayout parentLayout = new FormLayout(); |
|
| 382 |
parent.setLayout(parentLayout); |
|
| 383 |
parent.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); |
|
| 384 |
|
|
| 385 | 379 |
Composite paramArea = this.getCommandParametersGroup(); |
| 386 | 380 |
paramArea.setLayout(new FormLayout()); |
| 387 | 381 |
|
| 388 | 382 |
// info&navigation panel |
| 389 |
final Composite infosArea = new Composite(parent, SWT.NONE); |
|
| 390 |
FormData infosLayoutData = new FormData(); |
|
| 391 |
infosLayoutData.top = new FormAttachment(paramArea, 0); |
|
| 392 |
infosLayoutData.left = new FormAttachment(0); |
|
| 393 |
infosLayoutData.right = new FormAttachment(100); |
|
| 394 |
infosArea.setLayoutData(infosLayoutData); |
|
| 383 |
final Composite infosArea = this.topToolBar.installGroup("Infos", "Informations and Navigation", null);
|
|
| 395 | 384 |
|
| 396 |
Composite resultArea = new Composite(parent, SWT.NONE); |
|
| 397 |
FormData resultLayoutData = new FormData(); |
|
| 398 |
resultLayoutData.top = new FormAttachment(infosArea, 0); |
|
| 399 |
resultLayoutData.left = new FormAttachment(0); |
|
| 400 |
resultLayoutData.right = new FormAttachment(100); |
|
| 401 |
resultLayoutData.bottom = new FormAttachment(100); |
|
| 402 |
resultArea.setLayoutData(resultLayoutData); |
|
| 385 |
Composite resultArea = this.getDisplayArea(); |
|
| 403 | 386 |
|
| 404 | 387 |
// on créé une Query, ici le pivot de la concordance est "[]" |
| 405 | 388 |
// Query Area: query itself + view properties |
| tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java (revision 508) | ||
|---|---|---|
| 47 | 47 |
super.createPartControl(parent); |
| 48 | 48 |
|
| 49 | 49 |
// Extend the chart editor tool bar |
| 50 |
ToolItem separator = new ToolItem(this.toolBar, SWT.SEPARATOR); |
|
| 50 |
ToolItem separator = new ToolItem(this.topToolBar, SWT.SEPARATOR);
|
|
| 51 | 51 |
|
| 52 | 52 |
|
| 53 | 53 |
// Show/hide columns |
| 54 |
final ToolItem showColumns = new ToolItem(this.toolBar, SWT.CHECK); |
|
| 54 |
final ToolItem showColumns = new ToolItem(this.topToolBar, SWT.CHECK);
|
|
| 55 | 55 |
// FIXME: keep this for offering an option "large icons" with text in buttons ? |
| 56 | 56 |
//showColumns.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_COLUMS_LABEL); |
| 57 | 57 |
showColumns.setToolTipText(CAUIMessages.CHART_TOOLBAR_BUTTON_SHOW_COLUMS_TOOLTIP); |
| ... | ... | |
| 59 | 59 |
showColumns.setSelection(this.getBooleanParameterValue(CAPreferences.SHOW_INDIVIDUALS)); |
| 60 | 60 |
|
| 61 | 61 |
// Show/hide rows |
| 62 |
final ToolItem showRows = new ToolItem(this.toolBar, SWT.CHECK); |
|
| 62 |
final ToolItem showRows = new ToolItem(this.topToolBar, SWT.CHECK);
|
|
| 63 | 63 |
// FIXME: keep this for offering an option "large icons" with text in buttons ? |
| 64 | 64 |
//this.showRows.setText(SWTComponentsProviderMessages.SWTChartsComponentProvider_CA_TOOLBAR_BUTTON_SHOW_ROWS_LABEL); |
| 65 | 65 |
showRows.setToolTipText(CAUIMessages.CHART_TOOLBAR_BUTTON_SHOW_ROWS_TOOLTIP); |
| ... | ... | |
| 67 | 67 |
showRows.setSelection(this.getBooleanParameterValue(CAPreferences.SHOW_VARIABLES)); |
| 68 | 68 |
|
| 69 | 69 |
// Show/hide point shapes |
| 70 |
final ToolItem showPointShapes = new ToolItem(this.toolBar, SWT.CHECK); |
|
| 70 |
final ToolItem showPointShapes = new ToolItem(this.topToolBar, SWT.CHECK);
|
|
| 71 | 71 |
// FIXME: keep this for offering an option "large icons" with text in buttons ? |
| 72 | 72 |
//showPointShapes.setText(CAUIMessages.SHOW_HIDE_POINT_SHAPES); |
| 73 | 73 |
showPointShapes.setToolTipText(CAUIMessages.CHART_TOOLBAR_BUTTON_SHOW_HIDE_POINT_SHAPES); |
| ... | ... | |
| 78 | 78 |
|
| 79 | 79 |
|
| 80 | 80 |
// Factors plane selection |
| 81 |
ToolItem itemSeparator = new ToolItem(this.toolBar, SWT.SEPARATOR); |
|
| 82 |
CLabel factorsLabel = new CLabel(this.toolBar, SWT.CENTER); |
|
| 81 |
ToolItem itemSeparator = new ToolItem(this.topToolBar, SWT.SEPARATOR);
|
|
| 82 |
CLabel factorsLabel = new CLabel(this.topToolBar, SWT.CENTER);
|
|
| 83 | 83 |
factorsLabel.setText(CAUIMessages.CHART_TOOLBAR_AXES_SELECTION_COMBO_BOX_LABEL); |
| 84 | 84 |
factorsLabel.pack(); |
| 85 | 85 |
itemSeparator.setWidth(factorsLabel.getBounds().width); |
| 86 | 86 |
itemSeparator.setControl(factorsLabel); |
| 87 | 87 |
|
| 88 |
final Combo plansCombo = new Combo(this.toolBar, SWT.READ_ONLY); |
|
| 88 |
final Combo plansCombo = new Combo(this.topToolBar, SWT.READ_ONLY);
|
|
| 89 | 89 |
|
| 90 | 90 |
// FIXME: commented because the infos panel is not ready to manage more axes |
| 91 | 91 |
// ArrayList<String> planes = null; |
| ... | ... | |
| 128 | 128 |
} |
| 129 | 129 |
|
| 130 | 130 |
|
| 131 |
ToolItem comboItem = new ToolItem(this.toolBar, SWT.SEPARATOR); |
|
| 131 |
ToolItem comboItem = new ToolItem(this.topToolBar, SWT.SEPARATOR);
|
|
| 132 | 132 |
comboItem.setControl(plansCombo); |
| 133 | 133 |
plansCombo.pack(); |
| 134 | 134 |
comboItem.setWidth(plansCombo.getBounds().width); |
| tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor2.java (revision 508) | ||
|---|---|---|
| 190 | 190 |
|
| 191 | 191 |
super.createPartControl(parent); |
| 192 | 192 |
|
| 193 |
Composite paramArea = new Composite(this.commandParametersGroup, SWT.NONE);
|
|
| 193 |
Composite paramArea = new Composite(this.getCommandParametersGroup(), SWT.NONE);
|
|
| 194 | 194 |
|
| 195 | 195 |
GridLayout paramLayout = new GridLayout(5, false); |
| 196 | 196 |
paramArea.setLayout(paramLayout); |
| ... | ... | |
| 455 | 455 |
|
| 456 | 456 |
createContextMenu(viewer); |
| 457 | 457 |
|
| 458 |
this.commandParametersGroup.pack(); |
|
| 458 |
//this.commandParametersGroup.pack();
|
|
| 459 | 459 |
} |
| 460 | 460 |
|
| 461 | 461 |
private void refreshColNames() throws StatException, CqiClientException {
|
| tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 508) | ||
|---|---|---|
| 65 | 65 |
import org.eclipse.swt.events.MouseAdapter; |
| 66 | 66 |
import org.eclipse.swt.events.MouseEvent; |
| 67 | 67 |
import org.eclipse.swt.events.MouseListener; |
| 68 |
import org.eclipse.swt.events.SelectionAdapter; |
|
| 68 | 69 |
import org.eclipse.swt.events.SelectionEvent; |
| 69 | 70 |
import org.eclipse.swt.events.SelectionListener; |
| 70 | 71 |
import org.eclipse.swt.graphics.Font; |
| ... | ... | |
| 85 | 86 |
import org.eclipse.swt.widgets.Label; |
| 86 | 87 |
import org.eclipse.swt.widgets.Listener; |
| 87 | 88 |
import org.eclipse.swt.widgets.Menu; |
| 89 |
import org.eclipse.swt.widgets.Sash; |
|
| 88 | 90 |
import org.eclipse.swt.widgets.ScrollBar; |
| 91 |
import org.eclipse.swt.widgets.Table; |
|
| 89 | 92 |
import org.eclipse.swt.widgets.TableColumn; |
| 90 | 93 |
import org.eclipse.swt.widgets.Text; |
| 91 | 94 |
import org.eclipse.ui.IEditorInput; |
| ... | ... | |
| 168 | 171 |
import org.txm.utils.logger.Log; |
| 169 | 172 |
|
| 170 | 173 |
/** |
| 171 |
* display the concordances parameters and results in the same editor
|
|
| 174 |
* Displays the concordances parameters and results in the same editor
|
|
| 172 | 175 |
* |
| 173 | 176 |
* @author mdecorde. |
| 174 | 177 |
*/ |
| 175 | 178 |
public class ConcordanceEditor extends TXMEditorPart {
|
| 176 | 179 |
|
| 177 | 180 |
public static final String ID = ConcordanceEditor.class.getName(); |
| 178 |
|
|
| 181 |
|
|
| 179 | 182 |
/** |
| 180 | 183 |
* the limit number of annotation when a confirm dialog box is shown |
| 181 | 184 |
*/ |
| ... | ... | |
| 212 | 215 |
|
| 213 | 216 |
/** The available sort properties. */ |
| 214 | 217 |
private List<Property> availableKeywordSortProperties; |
| 215 |
|
|
| 216 | 218 |
/** The selected keyword sort property. */ |
| 217 | 219 |
private List<Property> selectedKeywordSortProperties; |
| 218 | 220 |
/** The selected left sort property. */ |
| ... | ... | |
| 267 | 269 |
private AssistedQueryWidget queryWidget; |
| 268 | 270 |
|
| 269 | 271 |
/** The line table viewer. */ |
| 270 |
private TableViewer viewer; |
|
| 272 |
private TableViewer viewer, viewer2;
|
|
| 271 | 273 |
|
| 272 | 274 |
/** The reference column. */ |
| 273 | 275 |
private TableColumn referenceColumn; |
| ... | ... | |
| 343 | 345 |
/** The annot btn. */ |
| 344 | 346 |
private Button annotationButton; |
| 345 | 347 |
|
| 346 |
// /** The selected typed value for new annotations **/ |
|
| 347 |
// private TypedValue annotSelectedTypedValue; |
|
| 348 |
// private AnnotationType annotSelectedType; |
|
| 349 |
|
|
| 350 | 348 |
private Text annotationValuesText; |
| 351 | 349 |
private ComboViewer annotationTypesCombo; |
| 352 | 350 |
|
| ... | ... | |
| 363 | 361 |
|
| 364 | 362 |
private TableColumn annotationColumn; |
| 365 | 363 |
|
| 366 |
// private Button addAnnotationButton; |
|
| 367 |
// private Button deleteAnnotationButton; |
|
| 368 | 364 |
private Combo addRemoveCombo; |
| 369 | 365 |
private Combo affectCombo; |
| 370 | 366 |
private Button affectAnnotationButton; |
| 371 |
// private Button affectAnnotationToSelectionButton; |
|
| 372 |
// private Button affectAnnotationToConcordanceButton; |
|
| 373 |
// private Button affectAnnotationToPageButton; |
|
| 374 | 367 |
|
| 375 |
private Label aLabel; |
|
| 376 |
|
|
| 377 | 368 |
private Button infosAnnotTypeSelectedLink; |
| 378 | 369 |
|
| 379 |
// private TableColumnLayout tableLayout;
|
|
| 370 |
private Sash sash;
|
|
| 380 | 371 |
|
| 381 |
|
|
| 382 | 372 |
/* (non-Javadoc) |
| 383 | 373 |
* @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor) |
| 384 | 374 |
*/ |
| 385 | 375 |
@Override |
| 386 |
public void doSave(IProgressMonitor monitor) {
|
|
| 387 |
} |
|
| 376 |
public void doSave(IProgressMonitor monitor) { }
|
|
| 388 | 377 |
|
| 389 | 378 |
/* (non-Javadoc) |
| 390 | 379 |
* @see org.eclipse.ui.part.EditorPart#doSaveAs() |
| 391 | 380 |
*/ |
| 392 | 381 |
@Override |
| 393 |
public void doSaveAs() {
|
|
| 394 |
} |
|
| 382 |
public void doSaveAs() { }
|
|
| 395 | 383 |
|
| 396 | 384 |
/* (non-Javadoc) |
| 397 | 385 |
* @see org.eclipse.ui.part.EditorPart#isDirty() |
| ... | ... | |
| 430 | 418 |
} |
| 431 | 419 |
|
| 432 | 420 |
private void initializeEditor() throws PartInitException {
|
| 433 |
|
|
| 421 |
|
|
| 434 | 422 |
TXMResultEditorInput input = getEditorInput(); |
| 435 | 423 |
TXMResult result = input.getResult(); |
| 436 | 424 |
if (!(result instanceof Concordance)) {
|
| ... | ... | |
| 484 | 472 |
*/ |
| 485 | 473 |
@Override |
| 486 | 474 |
public void createPartControl(Composite parent) {
|
| 487 |
this.parent = parent;
|
|
| 488 |
// GridLayout layout = new GridLayout(1, false); |
|
| 489 |
// layout.horizontalSpacing = 0;
|
|
| 490 |
// layout.verticalSpacing = 0;
|
|
| 491 |
// parent.setLayout(layout);
|
|
| 475 |
super.createPartControl(parent); // create the top toolbar, display area and bottom toolbar
|
|
| 476 |
|
|
| 477 |
// this.parent = parent;
|
|
| 478 |
//
|
|
| 479 |
// parent.setLayout(new FormLayout());
|
|
| 492 | 480 |
|
| 493 |
parent.setLayout(new FormLayout());
|
|
| 481 |
Composite controlArea = getCommandParametersGroup();
|
|
| 494 | 482 |
|
| 495 |
Composite controlArea = new Composite(parent, SWT.NONE); // the form |
|
| 496 |
FormData formdata1 = new FormData(); |
|
| 497 |
formdata1.top = new FormAttachment(0); |
|
| 498 |
//formdata1.bottom = new FormAttachment(100); |
|
| 499 |
formdata1.left = new FormAttachment(0); |
|
| 500 |
formdata1.right = new FormAttachment(100); |
|
| 501 |
controlArea.setLayoutData(formdata1); |
|
| 502 |
|
|
| 503 |
|
|
| 504 |
Composite displayArea = new Composite(parent, SWT.NONE); // the lines |
|
| 505 |
FormData formdata2 = new FormData(); |
|
| 506 |
formdata2.top = new FormAttachment(controlArea); |
|
| 507 |
formdata2.bottom = new FormAttachment(100); |
|
| 508 |
formdata2.left = new FormAttachment(0); |
|
| 509 |
formdata2.right = new FormAttachment(100); |
|
| 510 |
displayArea.setLayoutData(formdata2); |
|
| 511 |
|
|
| 512 |
composeControlArea(controlArea); |
|
| 513 |
composeDisplayArea(displayArea); |
|
| 514 |
|
|
| 515 |
//if (concordance != null) |
|
| 516 |
// fillDisplayArea(0, nLinePerPage); |
|
| 483 |
try {
|
|
| 484 |
composeControlArea(controlArea); |
|
| 485 |
composeDisplayArea(getDisplayArea()); |
|
| 486 |
} catch(Exception e) {
|
|
| 487 |
System.out.println("Error while building interface: "+e.getLocalizedMessage());
|
|
| 488 |
Log.printStackTrace(e); |
|
| 489 |
} |
|
| 517 | 490 |
} |
| 518 | 491 |
|
| 519 | 492 |
/** |
| ... | ... | |
| 521 | 494 |
* |
| 522 | 495 |
* @param displayArea the display area |
| 523 | 496 |
*/ |
| 524 |
private void composeDisplayArea(final Composite displayArea) {
|
|
| 497 |
private void composeDisplayArea(final Composite displayArea) throws Exception {
|
|
| 525 | 498 |
// tableLayout = new TableColumnLayout(); |
| 526 |
displayArea.setLayout(new GridLayout(1, true));
|
|
| 499 |
displayArea.setLayout(new FormLayout());
|
|
| 527 | 500 |
|
| 528 |
viewer = new TableViewer(displayArea, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER); |
|
| 501 |
viewer2 = new TableViewer(displayArea, SWT.MULTI | SWT.BORDER | SWT.VIRTUAL); |
|
| 502 |
viewer2.getTable().addKeyListener(new TableKeyListener(viewer2)); |
|
| 503 |
viewer2.setLabelProvider(new LineLabelProvider(this) {
|
|
| 504 |
@Override |
|
| 505 |
public String getColumnText(Object element, int columnIndex) {
|
|
| 506 |
if (columnIndex == 1) {
|
|
| 507 |
Line line = (Line) element; |
|
| 508 |
return line.getViewRef().toString(); |
|
| 509 |
} else {
|
|
| 510 |
return ""; |
|
| 511 |
} |
|
| 512 |
} |
|
| 513 |
}); |
|
| 514 |
viewer2.setContentProvider(new ConcordancesProvider()); |
|
| 515 |
viewer2.getTable().setLinesVisible(true); |
|
| 516 |
viewer2.getTable().setHeaderVisible(true); |
|
| 517 |
|
|
| 518 |
firstColumn = new TableColumn(viewer2.getTable(), SWT.LEFT); |
|
| 519 |
firstColumn.setWidth(0); |
|
| 520 |
|
|
| 521 |
referenceColumn = new TableColumn(viewer2.getTable(), SWT.LEFT); |
|
| 522 |
refreshReferenceColumnTitle(); |
|
| 523 |
referenceColumn.setToolTipText(Messages.ConcordancesEditor_1); |
|
| 524 |
referenceColumn.addSelectionListener(new SelectionListener() {
|
|
| 525 |
@Override |
|
| 526 |
public void widgetSelected(SelectionEvent e) {
|
|
| 527 |
StatusLine.setMessage(Messages.ConcordancesEditor_37); |
|
| 528 |
LineComparator comparator = new PropertiesReferenceComparator(); |
|
| 529 |
if (viewer2.getTable().getSortColumn() != referenceColumn) {
|
|
| 530 |
viewer2.getTable().setSortColumn(null); |
|
| 531 |
viewer2.getTable().setSortColumn(referenceColumn); |
|
| 532 |
viewer2.getTable().setSortDirection(SWT.UP); |
|
| 533 |
} else if (viewer2.getTable().getSortDirection() == SWT.UP) {
|
|
| 534 |
viewer2.getTable().setSortDirection(SWT.DOWN); |
|
| 535 |
comparator = new ReverseComparator(comparator); |
|
| 536 |
} else {
|
|
| 537 |
viewer2.getTable().setSortDirection(SWT.UP); |
|
| 538 |
} |
|
| 539 |
comparator.initialize(corpus); |
|
| 540 |
currentComparator = comparator; |
|
| 541 |
complexsorter.setKey(4);//set ref key |
|
| 542 |
sort(); |
|
| 543 |
StatusLine.setMessage(""); //$NON-NLS-1$
|
|
| 544 |
} |
|
| 545 |
|
|
| 546 |
@Override |
|
| 547 |
public void widgetDefaultSelected(SelectionEvent e) {
|
|
| 548 |
} |
|
| 549 |
}); |
|
| 550 |
referenceColumn.setWidth(100); |
|
| 551 |
|
|
| 552 |
firstColumn = new TableColumn(viewer2.getTable(), SWT.LEFT); |
|
| 553 |
firstColumn.setWidth(0); |
|
| 554 |
|
|
| 555 |
sash = new Sash(displayArea, SWT.VERTICAL); |
|
| 556 |
sash.addSelectionListener(new SelectionAdapter() {
|
|
| 557 |
public void widgetSelected(SelectionEvent event) {
|
|
| 558 |
((FormData) sash.getLayoutData()).left = new FormAttachment(0, event.x); |
|
| 559 |
sash.getParent().layout(); |
|
| 560 |
} |
|
| 561 |
}); |
|
| 562 |
viewer = new TableViewer(displayArea, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER | SWT.VIRTUAL); |
|
| 529 | 563 |
viewer.getTable().addKeyListener(new TableKeyListener(viewer)); |
| 530 | 564 |
viewer.setLabelProvider(new LineLabelProvider(this)); |
| 531 | 565 |
viewer.setContentProvider(new ConcordancesProvider()); |
| 532 |
viewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
|
| 566 |
viewer.getTable().setLinesVisible(true); |
|
| 567 |
viewer.getTable().setHeaderVisible(true); |
|
| 533 | 568 |
|
| 534 | 569 |
if (corpus != null && corpus.getFont() != null && corpus.getFont().length() > 0) {
|
| 535 | 570 |
Font old = viewer.getTable().getFont(); |
| 536 | 571 |
FontData fD = old.getFontData()[0]; |
| 537 | 572 |
Font font = new Font(Display.getCurrent(), corpus.getFont(), fD.getHeight(), fD.getStyle()); |
| 538 | 573 |
viewer.getTable().setFont(font); |
| 574 |
viewer2.getTable().setFont(font); |
|
| 539 | 575 |
} |
| 540 | 576 |
|
| 541 | 577 |
viewer.getTable().addListener(SWT.Resize, new Listener() {
|
| ... | ... | |
| 554 | 590 |
}); |
| 555 | 591 |
|
| 556 | 592 |
//TODO: to enable line deletion, Concordance code must updated -> replace with key binding |
| 557 |
viewer.getTable().addKeyListener(new KeyListener() {
|
|
| 558 |
|
|
| 593 |
KeyListener kldelete = new KeyListener() {
|
|
| 559 | 594 |
@Override |
| 560 | 595 |
public void keyReleased(KeyEvent e) { }
|
| 561 |
|
|
| 562 | 596 |
@Override |
| 563 | 597 |
public void keyPressed(KeyEvent e) {
|
| 564 | 598 |
if (e.keyCode != SWT.DEL ) { return; }
|
| 565 |
|
|
| 566 | 599 |
DeleteLines.deleteConcordanceLines(ConcordanceEditor.this); |
| 567 | 600 |
} |
| 568 |
}); |
|
| 601 |
}; |
|
| 602 |
viewer.getTable().addKeyListener(kldelete); |
|
| 603 |
viewer2.getTable().addKeyListener(kldelete); |
|
| 569 | 604 |
|
| 570 |
|
|
| 571 | 605 |
firstColumn = new TableColumn(viewer.getTable(), SWT.LEFT); |
| 572 | 606 |
firstColumn.setWidth(0); |
| 573 | 607 |
|
| 574 |
referenceColumn = new TableColumn(viewer.getTable(), SWT.V_SCROLL | SWT.H_SCROLL); |
|
| 575 |
refreshReferenceColumnTitle(); |
|
| 576 |
referenceColumn.setToolTipText(Messages.ConcordancesEditor_1); |
|
| 577 |
referenceColumn.setAlignment(SWT.LEFT); |
|
| 578 |
referenceColumn.addSelectionListener(new SelectionListener() {
|
|
| 579 |
@Override |
|
| 580 |
public void widgetSelected(SelectionEvent e) {
|
|
| 581 |
StatusLine.setMessage(Messages.ConcordancesEditor_37); |
|
| 582 |
LineComparator comparator = new PropertiesReferenceComparator(); |
|
| 583 |
if (viewer.getTable().getSortColumn() != referenceColumn) {
|
|
| 584 |
viewer.getTable().setSortColumn(null); |
|
| 585 |
viewer.getTable().setSortColumn(referenceColumn); |
|
| 586 |
viewer.getTable().setSortDirection(SWT.UP); |
|
| 587 |
} else if (viewer.getTable().getSortDirection() == SWT.UP) {
|
|
| 588 |
viewer.getTable().setSortDirection(SWT.DOWN); |
|
| 589 |
comparator = new ReverseComparator(comparator); |
|
| 590 |
} else {
|
|
| 591 |
viewer.getTable().setSortDirection(SWT.UP); |
|
| 592 |
} |
|
| 593 |
comparator.initialize(corpus); |
|
| 594 |
currentComparator = comparator; |
|
| 595 |
complexsorter.setKey(4);//set ref key |
|
| 596 |
sort(); |
|
| 597 |
StatusLine.setMessage(""); //$NON-NLS-1$
|
|
| 598 |
} |
|
| 599 |
|
|
| 600 |
@Override |
|
| 601 |
public void widgetDefaultSelected(SelectionEvent e) {
|
|
| 602 |
} |
|
| 603 |
}); |
|
| 604 |
|
|
| 605 | 608 |
leftContextColumn = new TableColumn(viewer.getTable(), SWT.RIGHT); |
| 606 | 609 |
leftContextColumn.setText(Messages.ConcordancesEditor_2); |
| 607 | 610 |
leftContextColumn.setToolTipText(Messages.ConcordancesEditor_2); |
| ... | ... | |
| 697 | 700 |
|
| 698 | 701 |
resetColumnWidths(); // set column widths |
| 699 | 702 |
|
| 700 |
viewer.getTable().setLinesVisible(true); |
|
| 701 |
viewer.getTable().setHeaderVisible(true); |
|
| 702 |
|
|
| 703 | 703 |
createContextMenu(); |
| 704 | 704 |
|
| 705 | 705 |
// And now, a sweet piece of code :) |
| ... | ... | |
| 754 | 754 |
} |
| 755 | 755 |
}; |
| 756 | 756 |
|
| 757 |
// Listeners to avoid 0 width clumns |
|
| 757 |
// Listeners to avoid 0 width columns
|
|
| 758 | 758 |
referenceColumn.addControlListener(new ControlListener() {
|
| 759 | 759 |
@Override |
| 760 | 760 |
public void controlMoved(ControlEvent e) { }
|
| ... | ... | |
| 802 | 802 |
}); |
| 803 | 803 |
|
| 804 | 804 |
viewer.getTable().addListener(SWT.EraseItem, eraseListener); |
| 805 |
|
|
| 806 |
leftTable = viewer2.getTable(); |
|
| 807 |
rightTable = viewer.getTable(); |
|
| 808 |
viewer2.getTable().addSelectionListener(new SelectionListener() {
|
|
| 809 |
@Override |
|
| 810 |
public void widgetSelected(SelectionEvent e) {
|
|
| 811 |
rightTable.setSelection(leftTable.getSelectionIndex()); |
|
| 812 |
} |
|
| 813 |
@Override |
|
| 814 |
public void widgetDefaultSelected(SelectionEvent e) { }
|
|
| 815 |
}); |
|
| 816 |
vBarLeft = viewer2.getTable().getVerticalBar(); |
|
| 817 |
vBarLeft.addListener(SWT.Selection, new Listener() {
|
|
| 818 |
@Override |
|
| 819 |
public void handleEvent(Event event) {
|
|
| 820 |
vBarRight.setSelection(vBarLeft.getSelection()); |
|
| 821 |
} |
|
| 822 |
}); |
|
| 823 |
viewer.getTable().addSelectionListener(new SelectionListener() {
|
|
| 824 |
@Override |
|
| 825 |
public void widgetSelected(SelectionEvent e) {
|
|
| 826 |
leftTable.setSelection(rightTable.getSelectionIndex()); |
|
| 827 |
} |
|
| 828 |
@Override |
|
| 829 |
public void widgetDefaultSelected(SelectionEvent e) { }
|
|
| 830 |
}); |
|
| 831 |
vBarRight = viewer.getTable().getVerticalBar(); |
|
| 832 |
vBarRight.addListener(SWT.Selection, new Listener() {
|
|
| 833 |
@Override |
|
| 834 |
public void handleEvent(Event event) {
|
|
| 835 |
vBarLeft.setSelection(vBarRight.getSelection()); |
|
| 836 |
} |
|
| 837 |
}); |
|
| 805 | 838 |
|
| 806 |
// tableLayout.setColumnData(firstColumn, new ColumnWeightData(0, false)); |
|
| 807 |
// tableLayout.setColumnData(referenceColumn, new ColumnWeightData(1, true)); |
|
| 808 |
// tableLayout.setColumnData(keywordColumn, new ColumnWeightData(1, true)); |
|
| 809 |
// tableLayout.setColumnData(leftContextColumn, new ColumnWeightData(1, true)); |
|
| 810 |
// tableLayout.setColumnData(annotationColumn, new ColumnWeightData(0, true)); |
|
| 811 |
// tableLayout.setColumnData(rightContextColumn, new ColumnWeightData(1, true)); |
|
| 839 |
// set Layout datas |
|
| 840 |
FormData data = new FormData(); |
|
| 841 |
data.top = new FormAttachment(0); |
|
| 842 |
data.bottom = new FormAttachment(100); |
|
| 843 |
data.left = new FormAttachment(0); |
|
| 844 |
data.right = new FormAttachment(sash,0); |
|
| 845 |
viewer2.getTable().setLayoutData(data); |
|
| 846 |
|
|
| 847 |
FormData data2 = new FormData(); |
|
| 848 |
data2.top = new FormAttachment(0, 0); |
|
| 849 |
data2.bottom = new FormAttachment(100, 0); |
|
| 850 |
data2.left = new FormAttachment(10); |
|
| 851 |
sash.setLayoutData(data2); |
|
| 852 |
|
|
| 853 |
FormData data3 = new FormData(); |
|
| 854 |
data3.top = new FormAttachment(0); |
|
| 855 |
data3.bottom = new FormAttachment(100); |
|
| 856 |
data3.left = new FormAttachment(sash,0); |
|
| 857 |
data3.right = new FormAttachment(100); |
|
| 858 |
viewer.getTable().setLayoutData(data3); |
|
| 812 | 859 |
} |
| 813 | 860 |
|
| 814 | 861 |
/** |
| ... | ... | |
| 879 | 926 |
return; |
| 880 | 927 |
|
| 881 | 928 |
viewer.getControl().setRedraw(false); |
| 929 |
viewer2.getControl().setRedraw(false); |
|
| 882 | 930 |
|
| 883 | 931 |
from = Math.max(from, 0); |
| 884 | 932 |
to = Math.min(to, concordance.getNLines() - 1); |
| ... | ... | |
| 894 | 942 |
lines = new ArrayList<Line>(); |
| 895 | 943 |
|
| 896 | 944 |
viewer.setInput(lines); |
| 897 |
referenceColumn.pack(); |
|
| 945 |
viewer2.setInput(lines); |
|
| 946 |
// referenceColumn.pack(); |
|
| 898 | 947 |
leftContextColumn.pack(); |
| 899 | 948 |
keywordColumn.pack(); |
| 900 | 949 |
rightContextColumn.pack(); |
| 901 | 950 |
viewer.getTable().pack(true); |
| 902 | 951 |
viewer.getTable().getParent().layout(); |
| 952 |
// viewer2.getTable().pack(true); |
|
| 953 |
viewer2.getTable().getParent().layout(); |
|
| 903 | 954 |
|
| 904 | 955 |
topLine = from; |
| 905 | 956 |
bottomLine = to; |
| ... | ... | |
| 917 | 968 |
refreshReferenceColumnTitle(); |
| 918 | 969 |
|
| 919 | 970 |
viewer.getControl().setRedraw(true); |
| 971 |
viewer2.getControl().setRedraw(true); |
|
| 920 | 972 |
} |
| 921 | 973 |
|
| 922 | 974 |
HashMap<AnnotationType, ArrayList<TypedValue>> history = new HashMap<AnnotationType, ArrayList<TypedValue>>(); |
| ... | ... | |
| 935 | 987 |
private Label equalLabel; |
| 936 | 988 |
Boolean advanced_annotation_mode = false; |
| 937 | 989 |
|
| 990 |
private Table leftTable; |
|
| 991 |
|
|
| 992 |
private Table rightTable; |
|
| 993 |
|
|
| 994 |
private ScrollBar vBarLeft; |
|
| 995 |
|
|
| 996 |
private ScrollBar vBarRight; |
|
| 997 |
|
|
| 938 | 998 |
private void composeAnnotationArea(final Composite parent){
|
| 939 | 999 |
advanced_annotation_mode = "advanced".equals(TXMPreferences.getString(AnnotationPreferences.ANNOTATION_MODE, RCPPreferences.PREFERENCES_NODE)); |
| 940 | 1000 |
|
| ... | ... | |
| 1328 | 1388 |
|
| 1329 | 1389 |
|
| 1330 | 1390 |
updateAnnotationWidgetStates(); |
| 1391 |
|
|
| 1392 |
|
|
| 1331 | 1393 |
|
| 1332 | 1394 |
parent.layout(); |
| 1333 | 1395 |
} |
| ... | ... | |
| 1924 | 1986 |
concordance.setAnnotationOverlap(true); |
| 1925 | 1987 |
} |
| 1926 | 1988 |
} |
| 1927 |
|
|
| 1989 |
|
|
| 1928 | 1990 |
concordance.compute(null); |
| 1929 |
|
|
| 1991 |
|
|
| 1930 | 1992 |
StatusLine.setMessage(NLS.bind(Messages.ConcordancesEditor_19, concordance.getNLines())); |
| 1931 | 1993 |
if (concordance.getNLines() == 1) |
| 1932 | 1994 |
System.out.println(Messages.ConcordancesEditor_52); |
| ... | ... | |
| 1935 | 1997 |
else |
| 1936 | 1998 |
System.out.println(TXMCoreMessages.COMPUTE_DONE_NO_RESULT); |
| 1937 | 1999 |
|
| 1938 |
|
|
| 1939 |
|
|
| 2000 |
|
|
| 2001 |
|
|
| 1940 | 2002 |
if (oldConcordance != null) {
|
| 1941 | 2003 |
corpus.removeResult(oldConcordance); |
| 1942 | 2004 |
oldConcordance.clean(); // drop the CQP corpus |
| ... | ... | |
| 1946 | 2008 |
CorporaView.refresh(); |
| 1947 | 2009 |
CorporaView.expand(corpus); |
| 1948 | 2010 |
QueriesView.refresh(); |
| 1949 |
|
|
| 2011 |
|
|
| 1950 | 2012 |
if (fillDisplay) {
|
| 1951 | 2013 |
fillDisplayArea(top, bottom); |
| 1952 | 2014 |
} |
| ... | ... | |
| 2238 | 2300 |
*/ |
| 2239 | 2301 |
public int getPointedColumn() {
|
| 2240 | 2302 |
int x = getMousePosition().x; // + lineTableViewer.getTable().get; |
| 2241 |
int sumWidthColumn = this.referenceColumn.getWidth(); |
|
| 2242 |
if (x < sumWidthColumn) |
|
| 2243 |
return 0; |
|
| 2303 |
int sumWidthColumn = 0; |
|
| 2244 | 2304 |
|
| 2245 | 2305 |
sumWidthColumn += this.leftContextColumn.getWidth(); |
| 2246 | 2306 |
if (x < sumWidthColumn) |
| ... | ... | |
| 2819 | 2879 |
annotationColumn.setWidth(0); |
| 2820 | 2880 |
// tableLayout.setColumnData(annotationColumn, new ColumnWeightData(0, false)); |
| 2821 | 2881 |
} |
| 2882 |
// |
|
| 2883 |
// referenceColumn.pack(); |
|
| 2884 |
// leftContextColumn.pack(); |
|
| 2885 |
// keywordColumn.pack(); |
|
| 2886 |
// rightContextColumn.pack(); |
|
| 2822 | 2887 |
|
| 2823 |
referenceColumn.pack(); |
|
| 2824 |
leftContextColumn.pack(); |
|
| 2825 |
keywordColumn.pack(); |
|
| 2826 |
rightContextColumn.pack(); |
|
| 2827 |
|
|
| 2828 | 2888 |
//viewer.getTable().layout(true, true); |
| 2829 | 2889 |
} |
| 2830 | 2890 |
|
| ... | ... | |
| 2926 | 2986 |
this.refViewPattern = concordance.getRefViewPattern(); |
| 2927 | 2987 |
this.refSortPattern = concordance.getRefAnalysePattern(); |
| 2928 | 2988 |
} |
| 2989 |
} |
|
| 2929 | 2990 |
|
| 2991 |
public Composite getExtensionButtonComposite() {
|
|
| 2992 |
// TODO Auto-generated method stub |
|
| 2993 |
return null; |
|
| 2930 | 2994 |
} |
| 2931 | 2995 |
} |
| tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditorButton.java (revision 508) | ||
|---|---|---|
| 1 |
package org.txm.concordance.rcp.editors; |
|
| 2 |
|
|
| 3 |
import org.eclipse.swt.SWT; |
|
| 4 |
import org.eclipse.swt.widgets.Button; |
|
| 5 |
|
|
| 6 |
/** |
|
| 7 |
* Extension point class to add a column to the concordance result. |
|
| 8 |
* |
|
| 9 |
* You need to : |
|
| 10 |
* - define the ColumnLabelProvider methods |
|
| 11 |
* - set a Comparator called by the ColumnSorter |
|
| 12 |
* |
|
| 13 |
* @author mdecorde |
|
| 14 |
* |
|
| 15 |
*/ |
|
| 16 |
public abstract class ConcordanceEditorButton extends Button {
|
|
| 17 |
|
|
| 18 |
protected ConcordanceEditor editor; |
|
| 19 |
|
|
| 20 |
public ConcordanceEditorButton(ConcordanceEditor editor) {
|
|
| 21 |
super(editor.getExtensionButtonComposite(), SWT.PUSH); |
|
| 22 |
this.editor = editor; |
|
| 23 |
} |
|
| 24 |
|
|
| 25 |
/** |
|
| 26 |
* |
|
| 27 |
* @return the column name displayed in the concordance table widget |
|
| 28 |
*/ |
|
| 29 |
public abstract String getName(); |
|
| 30 |
|
|
| 31 |
public abstract boolean install(); |
|
| 32 |
} |
|
| 0 | 33 | |
| tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/LineLabelProvider.java (revision 508) | ||
|---|---|---|
| 67 | 67 |
case 0: |
| 68 | 68 |
case 6: |
| 69 | 69 |
return ""; //this is the fake column used to work around the fact that MS windows refuses to right align the 1st column //$NON-NLS-1$ |
| 70 |
// case 1: // moved to the left table |
|
| 71 |
// return line.getViewRef().toString(); |
|
| 70 | 72 |
case 1: |
| 71 |
return line.getViewRef().toString();
|
|
| 73 |
return line.leftContextToString();
|
|
| 72 | 74 |
case 2: |
| 73 |
return line.leftContextToString();
|
|
| 75 |
return line.keywordToString();
|
|
| 74 | 76 |
case 3: |
| 75 |
return line.keywordToString(); |
|
| 76 |
case 4: |
|
| 77 | 77 |
if (line.getAnnotation()!=null) {
|
| 78 | 78 |
String value = line.getAnnotationValue().getStandardName(); |
| 79 | 79 |
Annotation a = line.getAnnotation(); |
| ... | ... | |
| 90 | 90 |
} else {
|
| 91 | 91 |
return ""; |
| 92 | 92 |
} |
| 93 |
case 5:
|
|
| 93 |
case 4:
|
|
| 94 | 94 |
return line.rightContextToString(); |
| 95 | 95 |
default: |
| 96 | 96 |
throw new RuntimeException(Messages.LineLabelProvider_1); |
| tmp/org.txm.concordance.rcp/plugin.xml (revision 508) | ||
|---|---|---|
| 2 | 2 |
<?eclipse version="3.4"?> |
| 3 | 3 |
<plugin> |
| 4 | 4 |
<extension-point id="org.txm.rcp.extensionpoint.backtotext" name="Back to text" schema="schema/org.txm.rcp.extensionpoint.backtotext.exsd"/> |
| 5 |
<extension-point id="org.txm.concordance.rcp.concordanceeditor.button" name="concordance column" schema="schema/org.txm.concordance.rcp.concordanceeditor.button.exsd"/> |
|
| 5 | 6 |
|
| 6 | 7 |
<extension |
| 7 | 8 |
point="org.eclipse.core.runtime.adapters"> |
| tmp/org.txm.concordance.rcp/schema/org.txm.concordance.rcp.concordanceeditor.button.exsd (revision 508) | ||
|---|---|---|
| 1 |
<?xml version='1.0' encoding='UTF-8'?> |
|
| 2 |
<!-- Schema file written by PDE --> |
|
| 3 |
<schema targetNamespace="org.txm.concordance.rcp" xmlns="http://www.w3.org/2001/XMLSchema"> |
|
| 4 |
<annotation> |
|
| 5 |
<appinfo> |
|
| 6 |
<meta.schema plugin="org.txm.concordance.rcp" id="org.txm.concordance.rcp.concordanceeditor.button" name="concordance column"/> |
|
| 7 |
</appinfo> |
|
| 8 |
<documentation> |
|
| 9 |
Supplementary concordance bottom toolbar button |
|
| 10 |
</documentation> |
|
| 11 |
</annotation> |
|
| 12 |
|
|
| 13 |
<element name="extension"> |
|
| 14 |
<annotation> |
|
| 15 |
<appinfo> |
|
| 16 |
<meta.element /> |
|
| 17 |
</appinfo> |
|
| 18 |
</annotation> |
|
| 19 |
<complexType> |
|
| 20 |
<choice minOccurs="1" maxOccurs="unbounded"> |
|
| 21 |
<element ref="button"/> |
|
| 22 |
</choice> |
|
| 23 |
<attribute name="point" type="string" use="required"> |
|
| 24 |
<annotation> |
|
| 25 |
<documentation> |
|
| 26 |
|
|
| 27 |
</documentation> |
|
| 28 |
</annotation> |
|
| 29 |
</attribute> |
|
| 30 |
<attribute name="id" type="string"> |
|
| 31 |
<annotation> |
|
| 32 |
<documentation> |
|
| 33 |
|
|
| 34 |
</documentation> |
|
| 35 |
</annotation> |
|
| 36 |
</attribute> |
|
| 37 |
<attribute name="name" type="string"> |
|
| 38 |
<annotation> |
|
| 39 |
<documentation> |
|
| 40 |
|
|
| 41 |
</documentation> |
|
| 42 |
<appinfo> |
|
| 43 |
<meta.attribute translatable="true"/> |
|
| 44 |
</appinfo> |
|
| 45 |
</annotation> |
|
| 46 |
</attribute> |
|
| 47 |
</complexType> |
|
| 48 |
</element> |
|
| 49 |
|
|
| 50 |
<element name="button"> |
|
| 51 |
<complexType> |
|
| 52 |
<attribute name="class" type="string"> |
|
| 53 |
<annotation> |
|
| 54 |
<documentation> |
|
| 55 |
|
|
| 56 |
</documentation> |
|
| 57 |
<appinfo> |
|
| 58 |
<meta.attribute kind="java" basedOn="org.txm.concordance.rcp.editors.ConcordanceEditorButton:"/> |
|
| 59 |
</appinfo> |
|
| 60 |
</annotation> |
|
| 61 |
</attribute> |
|
| 62 |
<attribute name="name" type="string"> |
|
| 63 |
<annotation> |
|
| 64 |
<documentation> |
|
| 65 |
|
|
| 66 |
</documentation> |
|
| 67 |
</annotation> |
|
| 68 |
</attribute> |
|
| 69 |
</complexType> |
|
| 70 |
</element> |
|
| 71 |
|
|
| 72 |
<annotation> |
|
| 73 |
<appinfo> |
|
| 74 |
<meta.section type="since"/> |
|
| 75 |
</appinfo> |
|
| 76 |
<documentation> |
|
| 77 |
[Enter the first release in which this extension point appears.] |
|
| 78 |
</documentation> |
|
| 79 |
</annotation> |
|
| 80 |
|
|
| 81 |
<annotation> |
|
| 82 |
<appinfo> |
|
| 83 |
<meta.section type="examples"/> |
|
| 84 |
</appinfo> |
|
| 85 |
<documentation> |
|
| 86 |
[Enter extension point usage example here.] |
|
| 87 |
</documentation> |
|
Formats disponibles : Unified diff