Révision 525

tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/ParametersView.java (revision 525)
36 36
import org.eclipse.ui.PlatformUI;
37 37
import org.eclipse.ui.part.EditorPart;
38 38
import org.eclipse.ui.part.ViewPart;
39
import org.txm.core.results.TXMResult;
40
import org.txm.rcp.editors.TXMEditorPart;
39 41
//import org.txm.rcp.editors.referencer.ReferencerEditor;
40 42

  
41 43
/**
......
80 82
		if (editor == null) editor = opened;
81 83

  
82 84
		if (editor == null) currentEditorLabel.setText("No editor selected.");
85

  
86
		if (editor instanceof TXMEditorPart) {
87
			TXMEditorPart reditor = (TXMEditorPart)editor;
88
			StringBuffer buffer = new StringBuffer();
89
			TXMResult result = reditor.getResultData();
90
			buffer.append(""+result.toString()+"\n");
91
			buffer.append(""+result.getDetails()+"\n\n");
92

  
93

  
94
			try {
95
				String[] keys = result.getParametersKeys();
96
				buffer.append("Parameters ("+keys.length+"): \n");
97
				for (String key : keys)
98
					buffer.append(" - "+key+"="+result.getStringParameterValue(key)+"\n");
99
			} catch(Exception e) {
100
				System.out.println("Error: "+e.getLocalizedMessage());
101
			}
102
			currentEditorLabel.setText(buffer.toString());
103
		} else {
104
			currentEditorLabel.setText("Editor is not a TXMPartEditor: "+editor);
105
		}
83 106
		//		StringBuffer buffer = new StringBuffer();
84 107
		//		if (activated != null)
85 108
		//			buffer.append("\neditor activated: "+activated.getTitle());
......
91 114
		//			buffer.append("\neditor desactivated: "+desactivated.getTitle());
92 115
		//		if (opened != null)
93 116
		//			buffer.append("\neditor opened: "+opened.getTitle());
94
//		if (editor instanceof ConcordanceEditor) {
95
//			currentEditorLabel.setText("Concordances "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
96
//		} else if (editor instanceof IndexEditor) {
97
//			currentEditorLabel.setText("Index "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
98
//		} else if (editor instanceof CooccurrencesEditor) {
99
//			currentEditorLabel.setText("Cooccurences "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
100
////		} else if (editor instanceof CAEditor) {
101
//			currentEditorLabel.setText("CaEditor "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
102
//		} else if (editor instanceof ReferencerEditor) {
103
//			currentEditorLabel.setText("References "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
104
//		}
117
		//		if (editor instanceof ConcordanceEditor) {
118
		//			currentEditorLabel.setText("Concordances "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
119
		//		} else if (editor instanceof IndexEditor) {
120
		//			currentEditorLabel.setText("Index "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
121
		//		} else if (editor instanceof CooccurrencesEditor) {
122
		//			currentEditorLabel.setText("Cooccurences "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
123
		////		} else if (editor instanceof CAEditor) {
124
		//			currentEditorLabel.setText("CaEditor "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
125
		//		} else if (editor instanceof ReferencerEditor) {
126
		//			currentEditorLabel.setText("References "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
127
		//		}
105 128
	}
106 129

  
107 130
	/* (non-Javadoc)
......
109 132
	 */
110 133
	@Override
111 134
	public void createPartControl(Composite parent) {
135
		System.out.println("createPartControl: "+parent);
112 136
		currentEditorLabel = new Label(parent, SWT.NONE);
113 137
		updateEditorParameters();
114 138
	}
115 139

  
116 140
	@Override
117 141
	public void partActivated(IWorkbenchPart part) {
142
		System.out.println("partActivated: "+part);
118 143
		if (part instanceof EditorPart)
119 144
			activated = (EditorPart)part;
120 145
		updateEditorParameters();
......
122 147

  
123 148
	@Override
124 149
	public void partBroughtToTop(IWorkbenchPart part) {
150
		System.out.println("partBroughtToTop: "+part);
125 151
		if (part instanceof EditorPart)
126 152
			broughtToTop = (EditorPart)part;
127 153
		//updateLabel();
......
129 155

  
130 156
	@Override
131 157
	public void partClosed(IWorkbenchPart part) {
158
		System.out.println("partClosed: "+part);
132 159
		if (part instanceof EditorPart) {
133 160
			closed = (EditorPart)part;
134 161
		}
......
137 164

  
138 165
	@Override
139 166
	public void partDeactivated(IWorkbenchPart part) {
167
		System.out.println("partDeactivated: "+part);
140 168
		if (part instanceof EditorPart)
141 169
			desactivated = (EditorPart)part;
142 170
		//updateLabel();
......
144 172

  
145 173
	@Override
146 174
	public void partOpened(IWorkbenchPart part) {
175
		System.out.println("partOpened: "+part);
147 176
		if (part instanceof EditorPart)
148 177
			opened = (EditorPart)part;
149 178
		//updateLabel();
tmp/org.txm.rcp/plugin.xml (revision 525)
174 174
            name="%view.name.8"
175 175
            restorable="true">
176 176
      </view>
177
      <view
178
            category="org.txm.rcp"
179
            class="org.txm.rcp.views.cmdparameters.ParametersView"
180
            icon="icons/functions/Properties.png"
181
            id="org.txm.rcp.views.cmdparameters.ParametersView"
182
            name="ParametersView"
183
            restorable="true">
184
      </view>
177 185
   </extension>
178 186
   <extension
179 187
         point="org.eclipse.core.runtime.adapters">
tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 525)
839 839
			e.printStackTrace();
840 840
		}
841 841
	}
842
	
843
	/**
844
	 * Dumps the keys and values of the specified node.
845
	 * @param nodeQualifier
846
	 * @throws BackingStoreException 
847
	 */
848
	public static String[] getKeys(String nodeQualifier) throws BackingStoreException	{
849
		IEclipsePreferences preferences = scope.getNode(nodeQualifier);
850
		return preferences.keys();
851
	}
842 852

  
843 853

  
844 854
	/**
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 525)
11 11
import java.util.UUID;
12 12

  
13 13
import org.osgi.framework.FrameworkUtil;
14
import org.osgi.service.prefs.BackingStoreException;
14 15
import org.txm.core.preferences.TXMPreferences;
15 16

  
16 17
/**
......
128 129
	public String getPreferencesNodeQualifier() {
129 130
		return preferencesNodeQualifier;
130 131
	}
132
	
133
	public String[] getParametersKeys() throws BackingStoreException {
134
		return TXMPreferences.getKeys(this.preferencesNodeQualifier);
135
	}
131 136

  
132 137
	/**
133 138
	 * Gets the value of the specified key in parameters, local result node or default preferences nodes.

Formats disponibles : Unified diff