Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 168562
Collapse All | Expand All

(-)src/org/eclipse/tptp/platform/log/views/internal/views/CommonBaseSection.java (-2 / +54 lines)
Lines 1-5 Link Here
1
/********************************************************************** 
1
/********************************************************************** 
2
 * Copyright (c) 2005, 2006  IBM Corporation and others. 
2
 * Copyright (c) 2005, 2007  IBM Corporation and others. 
3
 * All rights reserved.   This program and the accompanying materials 
3
 * All rights reserved.   This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0 
4
 * are made available under the terms of the Eclipse Public License v1.0 
5
 * which accompanies this distribution, and is available at 
5
 * which accompanies this distribution, and is available at 
Lines 12-19 Link Here
12
12
13
package org.eclipse.tptp.platform.log.views.internal.views;
13
package org.eclipse.tptp.platform.log.views.internal.views;
14
14
15
import org.eclipse.emf.common.util.EList;
15
import org.eclipse.hyades.models.cbe.CBECommonBaseEvent;
16
import org.eclipse.hyades.models.cbe.CBECommonBaseEvent;
16
import org.eclipse.hyades.models.cbe.CBEDefaultEvent;
17
import org.eclipse.hyades.models.cbe.CBEDefaultEvent;
18
import org.eclipse.hyades.models.cbe.CBEExtendedDataElement;
17
import org.eclipse.jface.viewers.ISelection;
19
import org.eclipse.jface.viewers.ISelection;
18
import org.eclipse.jface.viewers.IStructuredSelection;
20
import org.eclipse.jface.viewers.IStructuredSelection;
19
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.SWT;
Lines 167-173 Link Here
167
    	 	extensionNameText.setText(cbeEvent.getExtensionName()!=null ? cbeEvent.getExtensionName() : "");
169
    	 	extensionNameText.setText(cbeEvent.getExtensionName()!=null ? cbeEvent.getExtensionName() : "");
168
    	 	sequenceNumberText.setText(cbeEvent.getSequenceNumber()+""); //$NON-NLS-1$
170
    	 	sequenceNumberText.setText(cbeEvent.getSequenceNumber()+""); //$NON-NLS-1$
169
    	 	severityText.setText(cbeEvent.getSeverity()+""); //$NON-NLS-1$
171
    	 	severityText.setText(cbeEvent.getSeverity()+""); //$NON-NLS-1$
170
    	 	messageText.setText(cbeEvent.getMsg()!=null ? cbeEvent.getMsg() : "");
172
    	 	
173
    	 	/*
174
    	 	 * Bug 168562
175
    	 	 * If the message text is greater than 1024 bytes, the message is added into a 
176
    	 	 * single extended data element. We need to check if the "message" extended data
177
    	 	 * element exists and set the message accordingly.
178
    	 	 */    	 	
179
    	 	EList extendedProperties = cbeEvent.getExtendedProperties();  
180
    	 	int count = 0;
181
    	 	
182
    	 	while ( true ) {
183
    	 		try {
184
    	 			CBEExtendedDataElement cbeImpl = (CBEExtendedDataElement) extendedProperties.get( count );
185
    	 			
186
    	 			if ( cbeImpl.getName().equals("message") ) {
187
    	 				/* 
188
    	 				 * There is extended data holding a "message". This implies
189
    	 				 * the message is longer than 1024 bytes. We now need to 
190
    	 				 * concatinate the strings together to create the original message
191
    	 				 */
192
    	 				EList values = cbeImpl.getValues();
193
    	 				
194
    	 				StringBuffer sb = new StringBuffer();
195
    	 				for ( int j = 0; j < values.size(); j++ ) {
196
    	 					sb.append( (String) values.get( j ) );
197
    	 				}
198
    	 				
199
    	 				messageText.setText( sb.toString() );
200
    	 				break;
201
    	 			}
202
    	 			
203
    	 			if ( count == extendedProperties.size() - 1 ) {
204
    	 				/* No extended data message properties found - this implies 
205
    	 				 * it is sufficient to use the message returned by the 
206
    	 				 * getMsg() method.
207
    	 				 */
208
    	 				messageText.setText(cbeEvent.getMsg()!=null ? cbeEvent.getMsg() : "");
209
    	 				break;
210
    	 			}
211
    	 			
212
    	 			count++;
213
    	 			
214
    	 		} catch ( ClassCastException e ) {
215
    	 			/*
216
    	 			 * The extended data element is stored in the CBEExtendedDataElement class
217
    	 			 * If a class cast exception is thrown, we can ignore it because it
218
    	 			 * just means that there is other data stored as an extended property 
219
    	 			 */  
220
    	 		}
221
    	 	}
222
    	 	
171
    	 	//	versionText.addModifyListener(listener);
223
    	 	//	versionText.addModifyListener(listener);
172
    	 	//}
224
    	 	//}
173
    	      
225
    	      

Return to bug 168562