Révision 2405
| tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LineLabelProvider.java (revision 2405) | ||
|---|---|---|
| 43 | 43 |
*/ |
| 44 | 44 |
public class LineLabelProvider extends LabelProvider implements |
| 45 | 45 |
ITableLabelProvider {
|
| 46 |
|
|
| 46 |
|
|
| 47 | 47 |
/** The table. */ |
| 48 | 48 |
LexicalTable table; |
| 49 | 49 |
|
| ... | ... | |
| 67 | 67 |
|
| 68 | 68 |
/** The max. */ |
| 69 | 69 |
int max = 0; |
| 70 |
|
|
| 70 |
|
|
| 71 | 71 |
/** |
| 72 | 72 |
* Instantiates a new line label provider. |
| 73 | 73 |
* |
| ... | ... | |
| 84 | 84 |
cols.add(table.getData().getCol(i).asDoubleArray()); |
| 85 | 85 |
} |
| 86 | 86 |
freqs = table.getData().getRowMargins(); |
| 87 |
} catch (Exception e) {
|
|
| 87 |
} |
|
| 88 |
catch (Exception e) {
|
|
| 88 | 89 |
// TODO Auto-generated catch block |
| 89 | 90 |
org.txm.utils.logger.Log.printStackTrace(e); |
| 90 | 91 |
} |
| 91 | 92 |
} |
| 92 |
|
|
| 93 |
/* (non-Javadoc) |
|
| 93 |
|
|
| 94 |
/* |
|
| 95 |
* (non-Javadoc) |
|
| 94 | 96 |
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) |
| 95 | 97 |
*/ |
| 96 | 98 |
@Override |
| 97 | 99 |
public Image getColumnImage(Object element, int columnIndex) {
|
| 98 | 100 |
return null; |
| 99 | 101 |
} |
| 100 |
|
|
| 101 |
/* (non-Javadoc) |
|
| 102 |
|
|
| 103 |
/* |
|
| 104 |
* (non-Javadoc) |
|
| 102 | 105 |
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) |
| 103 | 106 |
*/ |
| 104 | 107 |
@Override |
| 105 | 108 |
public String getColumnText(Object element, int columnIndex) {
|
| 106 |
|
|
| 109 |
|
|
| 107 | 110 |
switch (columnIndex) {
|
| 108 |
case 0: |
|
| 109 |
return ""; //$NON-NLS-1$ |
|
| 110 |
case 1: |
|
| 111 |
return rownames[(Integer) element]; |
|
| 112 |
case 2: |
|
| 113 |
return "" + freqs[(Integer) element]; //$NON-NLS-1$ |
|
| 114 |
default: |
|
| 115 |
|
|
| 116 |
if (columnIndex == Ncols + 3) |
|
| 111 |
case 0: |
|
| 117 | 112 |
return ""; //$NON-NLS-1$ |
| 118 |
else |
|
| 119 |
return "" + (int) cols.get(columnIndex - 3)[(Integer) element]; //$NON-NLS-1$ |
|
| 113 |
case 1: |
|
| 114 |
return rownames[(Integer) element]; |
|
| 115 |
case 2: |
|
| 116 |
return "" + freqs[(Integer) element]; //$NON-NLS-1$ |
|
| 117 |
default: |
|
| 118 |
|
|
| 119 |
if (columnIndex == Ncols + 3) |
|
| 120 |
return ""; //$NON-NLS-1$ |
|
| 121 |
else |
|
| 122 |
return "" + (int) cols.get(columnIndex - 3)[(Integer) element]; //$NON-NLS-1$ |
|
| 120 | 123 |
} |
| 121 | 124 |
} |
| 122 |
|
|
| 125 |
|
|
| 123 | 126 |
/** |
| 124 | 127 |
* Gets the cols. |
| 125 | 128 |
* |
| ... | ... | |
| 128 | 131 |
public List<double[]> getCols() {
|
| 129 | 132 |
return cols; |
| 130 | 133 |
} |
| 131 |
|
|
| 134 |
|
|
| 132 | 135 |
/** |
| 133 | 136 |
* Gets the freqs. |
| 134 | 137 |
* |
| ... | ... | |
| 137 | 140 |
public int[] getFreqs() {
|
| 138 | 141 |
return freqs; |
| 139 | 142 |
} |
| 140 |
|
|
| 143 |
|
|
| 141 | 144 |
/** |
| 142 | 145 |
* Gets the total. |
| 143 | 146 |
* |
| ... | ... | |
| 146 | 149 |
public int getTotal() {
|
| 147 | 150 |
return tot; |
| 148 | 151 |
} |
| 149 |
|
|
| 152 |
|
|
| 150 | 153 |
/** |
| 151 | 154 |
* Gets the max. |
| 152 | 155 |
* |
| ... | ... | |
| 155 | 158 |
public int getMax() {
|
| 156 | 159 |
return max; |
| 157 | 160 |
} |
| 158 |
|
|
| 161 |
|
|
| 159 | 162 |
/** |
| 160 | 163 |
* Gets the rows. |
| 161 | 164 |
* |
| tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/MergeDeleteDialog.java (revision 2405) | ||
|---|---|---|
| 39 | 39 |
import org.txm.core.messages.TXMCoreMessages; |
| 40 | 40 |
import org.txm.rcp.messages.TXMUIMessages; |
| 41 | 41 |
import org.txm.rcp.swt.dialog.ObjectSelectionDialog; |
| 42 |
|
|
| 42 | 43 |
// TODO: Auto-generated Javadoc |
| 43 | 44 |
/** |
| 44 | 45 |
* The Class MergeDeleteDialog. |
| ... | ... | |
| 59 | 60 |
|
| 60 | 61 |
/** The mergename. */ |
| 61 | 62 |
private String mergename; |
| 62 |
|
|
| 63 |
|
|
| 63 | 64 |
/** |
| 64 | 65 |
* Instantiates a new merge delete dialog. |
| 65 | 66 |
* |
| ... | ... | |
| 71 | 72 |
public MergeDeleteDialog(Shell shell, List<Object> available, |
| 72 | 73 |
List<Object> selected, int max) {
|
| 73 | 74 |
super(shell, available, selected, max); |
| 74 |
//shell.setText("test");
|
|
| 75 |
// shell.setText("test");
|
|
| 75 | 76 |
} |
| 76 | 77 |
|
| 77 |
/* (non-Javadoc) |
|
| 78 |
/* |
|
| 79 |
* (non-Javadoc) |
|
| 78 | 80 |
* @see org.txm.rcp.swt.dialog.ObjectSelectionDialog#configureShell(org.eclipse.swt.widgets.Shell) |
| 79 | 81 |
*/ |
| 80 | 82 |
@Override |
| 81 | 83 |
protected void configureShell(Shell shell) {
|
| 82 |
super.configureShell(shell); |
|
| 83 |
shell.setText(TXMUIMessages.mergeDelete); |
|
| 84 |
} |
|
| 85 |
|
|
| 86 |
|
|
| 87 |
/* (non-Javadoc) |
|
| 84 |
super.configureShell(shell); |
|
| 85 |
shell.setText(TXMUIMessages.mergeDelete); |
|
| 86 |
} |
|
| 87 |
|
|
| 88 |
|
|
| 89 |
/* |
|
| 90 |
* (non-Javadoc) |
|
| 88 | 91 |
* @see org.txm.rcp.swt.dialog.ObjectSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite) |
| 89 | 92 |
*/ |
| 90 | 93 |
@Override |
| 91 | 94 |
protected Control createDialogArea(Composite parent) {
|
| 92 | 95 |
super.createDialogArea(parent); |
| 93 |
|
|
| 96 |
|
|
| 94 | 97 |
mergeRadio = new Button(mainArea, SWT.RADIO); |
| 95 | 98 |
mergeRadio.setText(TXMUIMessages.merge); |
| 96 | 99 |
mergeRadio.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1)); |
| ... | ... | |
| 103 | 106 |
newname = new Text(mainArea, SWT.SINGLE | SWT.BORDER); |
| 104 | 107 |
newname.setText(TXMUIMessages.mergeResultName); |
| 105 | 108 |
newname.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 4, 1)); |
| 106 |
|
|
| 109 |
|
|
| 107 | 110 |
return mainArea; |
| 108 | 111 |
} |
| 109 |
|
|
| 110 |
/* (non-Javadoc) |
|
| 112 |
|
|
| 113 |
/* |
|
| 114 |
* (non-Javadoc) |
|
| 111 | 115 |
* @see org.txm.rcp.swt.dialog.ObjectSelectionDialog#okPressed() |
| 112 | 116 |
*/ |
| 113 | 117 |
@Override |
| ... | ... | |
| 116 | 120 |
mergename = newname.getText(); |
| 117 | 121 |
super.okPressed(); |
| 118 | 122 |
} |
| 119 |
|
|
| 123 |
|
|
| 120 | 124 |
/** |
| 121 | 125 |
* Do merge. |
| 122 | 126 |
* |
| ... | ... | |
| 125 | 129 |
public boolean doMerge() {
|
| 126 | 130 |
return doMerge; |
| 127 | 131 |
} |
| 128 |
|
|
| 132 |
|
|
| 129 | 133 |
/** |
| 130 | 134 |
* Do delete. |
| 131 | 135 |
* |
| ... | ... | |
| 134 | 138 |
public boolean doDelete() {
|
| 135 | 139 |
return !doMerge; |
| 136 | 140 |
} |
| 137 |
|
|
| 141 |
|
|
| 138 | 142 |
/** |
| 139 | 143 |
* Gets the merge name. |
| 140 | 144 |
* |
| ... | ... | |
| 143 | 147 |
public String getMergeName() {
|
| 144 | 148 |
return mergename; |
| 145 | 149 |
} |
| 146 |
} |
|
| 150 |
} |
|
| tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/ColumnSelectionListener.java (revision 2405) | ||
|---|---|---|
| 19 | 19 |
*/ |
| 20 | 20 |
@Deprecated |
| 21 | 21 |
public class ColumnSelectionListener implements SelectionListener {
|
| 22 |
|
|
| 22 |
|
|
| 23 | 23 |
LexicalTableEditor editor; |
| 24 | 24 |
|
| 25 | 25 |
/** The col. */ |
| 26 | 26 |
TableViewerColumn col; |
| 27 |
|
|
| 27 |
|
|
| 28 | 28 |
/** The index. */ |
| 29 | 29 |
int index; |
| 30 |
|
|
| 30 |
|
|
| 31 | 31 |
/** |
| 32 | 32 |
* Instantiates a new column selection listener. |
| 33 | 33 |
* |
| ... | ... | |
| 39 | 39 |
this.col = formColumn; |
| 40 | 40 |
this.index = index; |
| 41 | 41 |
} |
| 42 |
|
|
| 43 |
/* (non-Javadoc) |
|
| 42 |
|
|
| 43 |
/* |
|
| 44 |
* (non-Javadoc) |
|
| 44 | 45 |
* @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent) |
| 45 | 46 |
*/ |
| 46 | 47 |
@Override |
| 47 |
public void widgetDefaultSelected(SelectionEvent e) {
|
|
| 48 |
} |
|
| 49 |
|
|
| 50 |
/* (non-Javadoc)
|
|
| 48 |
public void widgetDefaultSelected(SelectionEvent e) {}
|
|
| 49 |
|
|
| 50 |
/* |
|
| 51 |
* (non-Javadoc)
|
|
| 51 | 52 |
* @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent) |
| 52 | 53 |
*/ |
| 53 | 54 |
@Override |
| ... | ... | |
| 56 | 57 |
this.editor.sort(this.col, this.index); |
| 57 | 58 |
StatusLine.setMessage(""); //$NON-NLS-1$
|
| 58 | 59 |
} |
| 59 |
} |
|
| 60 |
} |
|
| tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LineContentProvider.java (revision 2405) | ||
|---|---|---|
| 38 | 38 |
* @author jmague |
| 39 | 39 |
*/ |
| 40 | 40 |
public class LineContentProvider implements IStructuredContentProvider {
|
| 41 |
|
|
| 41 |
|
|
| 42 | 42 |
/* |
| 43 | 43 |
* (non-Javadoc) |
| 44 |
* |
|
| 45 | 44 |
* @see |
| 46 | 45 |
* org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java |
| 47 | 46 |
* .lang.Object) |
| ... | ... | |
| 52 | 51 |
Integer[] lines; |
| 53 | 52 |
try {
|
| 54 | 53 |
lines = new Integer[table.getNRows()]; |
| 55 |
} catch (Exception e) {
|
|
| 54 |
} |
|
| 55 |
catch (Exception e) {
|
|
| 56 | 56 |
// TODO Auto-generated catch block |
| 57 | 57 |
e.printStackTrace(); |
| 58 | 58 |
return new Object[0]; |
| ... | ... | |
| 61 | 61 |
lines[i] = i; |
| 62 | 62 |
return lines; |
| 63 | 63 |
} |
| 64 |
|
|
| 64 |
|
|
| 65 | 65 |
/* |
| 66 | 66 |
* (non-Javadoc) |
| 67 |
* |
|
| 68 | 67 |
* @see org.eclipse.jface.viewers.IContentProvider#dispose() |
| 69 | 68 |
*/ |
| 70 | 69 |
@Override |
| 71 | 70 |
public void dispose() {
|
| 72 | 71 |
// TODO Auto-generated method stub |
| 73 |
|
|
| 72 |
|
|
| 74 | 73 |
} |
| 75 |
|
|
| 74 |
|
|
| 76 | 75 |
/* |
| 77 | 76 |
* (non-Javadoc) |
| 78 |
* |
|
| 79 | 77 |
* @see |
| 80 | 78 |
* org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface |
| 81 | 79 |
* .viewers.Viewer, java.lang.Object, java.lang.Object) |
| ... | ... | |
| 84 | 82 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
| 85 | 83 |
// TODO Auto-generated method stub |
| 86 | 84 |
} |
| 87 |
|
|
| 85 |
|
|
| 88 | 86 |
} |
Formats disponibles : Unified diff