Révision 847

tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/IndexToLexicalTable.java (revision 847)
44 44
import org.eclipse.ui.handlers.HandlerUtil;
45 45
import org.txm.index.core.functions.Index;
46 46
import org.txm.lexicaltable.core.functions.LexicalTable;
47
import org.txm.lexicaltable.rcp.editors.___LexicalTableEditorInput;
48
import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
47
//import org.txm.lexicaltable.rcp.editors.___LexicalTableEditorInput;
48
//import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
49 49
import org.txm.rcp.StatusLine;
50 50
import org.txm.rcp.handlers.BaseAbstractHandler;
51 51
import org.txm.rcp.messages.TXMUIMessages;
......
53 53
/**
54 54
 * The Class IndexToLexicalTable.
55 55
 */
56
// FIXME: not used?
56 57
public class IndexToLexicalTable extends BaseAbstractHandler {
57 58

  
58 59
	/** The window. */
......
87 88
	 * @param to the to
88 89
	 * @return true, if successful
89 90
	 */
90
	public boolean buildLexicalTable(Index voc, int from, int to) {
91
		LexicalTable table;
91
	// FIXME: SJ: temporary commented to avoid cyclic dependencies
92
//	public boolean buildLexicalTable(Index voc, int from, int to) {
93
//		LexicalTable table;
94
//
95
//		if (!voc.isComputedWithPartition()) {
96
//			
97
//			System.out.println(TXMUIMessages.IndexToLexicalTable_0);
98
//			StatusLine.setMessage(TXMUIMessages.IndexToLexicalTable_0);
99
//			return false;
100
//		}
101
//
102
//		System.out.println(LexicalTableUIMessages.ComputeLexicalTable_3);
103
//		ArrayList<String> choices = new ArrayList<String>();
104
//		choices.add(LexicalTableUIMessages.ComputeLexicalTable_16);
105
//		choices.add(LexicalTableUIMessages.ComputeLexicalTable_12);
106
//		ListSelectionDialog dialog = new ListSelectionDialog(shell, 
107
//				choices, new ArrayContentProvider(), new LabelProvider(), 
108
//				LexicalTableUIMessages.ComputeLexicalTable_13);
109
//		
110
//		int ret = dialog.open();
111
//		//System.out.println("ret= "+ret);
112
//		if (ret == Dialog.OK_OPTION) {
113
//			
114
//		} else {
115
//			return false;
116
//		}
117
//		
118
//		try {
119
//			table = new LexicalTable(voc);
120
//		} catch (Exception e) {
121
//			// TODO Auto-generated catch block
122
//			org.txm.rcp.utils.Logger.printStackTrace(e);
123
//			return false;
124
//		}
125
//
126
//		try {
127
//			IWorkbenchWindow window = PlatformUI.getWorkbench()
128
//					.getActiveWorkbenchWindow();
129
//			IWorkbenchPage page = window.getActivePage();
130
//			___LexicalTableEditorInput editorInput = new ___LexicalTableEditorInput(table);
131
//			StatusLine.setMessage(LexicalTableUIMessages.ComputeLexicalTable_10);
132
//			page.openEditor(editorInput, "org.txm.rcp.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
133
//		} catch (PartInitException e) {
134
//			org.txm.rcp.utils.Logger.printStackTrace(e);
135
//		} 
136
//
137
//		return true;
138
//	}
92 139

  
93
		if (!voc.isComputedWithPartition()) {
94
			
95
			System.out.println(TXMUIMessages.IndexToLexicalTable_0);
96
			StatusLine.setMessage(TXMUIMessages.IndexToLexicalTable_0);
97
			return false;
98
		}
99

  
100
		System.out.println(LexicalTableUIMessages.ComputeLexicalTable_3);
101
		ArrayList<String> choices = new ArrayList<String>();
102
		choices.add(LexicalTableUIMessages.ComputeLexicalTable_16);
103
		choices.add(LexicalTableUIMessages.ComputeLexicalTable_12);
104
		ListSelectionDialog dialog = new ListSelectionDialog(shell, 
105
				choices, new ArrayContentProvider(), new LabelProvider(), 
106
				LexicalTableUIMessages.ComputeLexicalTable_13);
107
		
108
		int ret = dialog.open();
109
		//System.out.println("ret= "+ret);
110
		if (ret == Dialog.OK_OPTION) {
111
			
112
		} else {
113
			return false;
114
		}
115
		
116
		try {
117
			table = new LexicalTable(voc);
118
		} catch (Exception e) {
119
			// TODO Auto-generated catch block
120
			org.txm.rcp.utils.Logger.printStackTrace(e);
121
			return false;
122
		}
123

  
124
		try {
125
			IWorkbenchWindow window = PlatformUI.getWorkbench()
126
					.getActiveWorkbenchWindow();
127
			IWorkbenchPage page = window.getActivePage();
128
			___LexicalTableEditorInput editorInput = new ___LexicalTableEditorInput(table);
129
			StatusLine.setMessage(LexicalTableUIMessages.ComputeLexicalTable_10);
130
			page.openEditor(editorInput, "org.txm.rcp.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
131
		} catch (PartInitException e) {
132
			org.txm.rcp.utils.Logger.printStackTrace(e);
133
		} 
134

  
135
		return true;
136
	}
137

  
138 140
}

Formats disponibles : Unified diff