Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 62103 Details for
Bug 179540
[Model Scalability] [Performance] Use eclipse virtual tree in the Log View editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
o.e.h.test.ui_0326.txt (text/plain), 12.27 KB, created by
Valentina Popescu
on 2007-03-27 10:35:18 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Valentina Popescu
Created:
2007-03-27 10:35:18 EDT
Size:
12.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.test.ui >Index: src/org/eclipse/hyades/test/ui/forms/util/EObjectTreeContentProvider.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src/org/eclipse/hyades/test/ui/forms/util/EObjectTreeContentProvider.java,v >retrieving revision 1.1 >diff -u -r1.1 EObjectTreeContentProvider.java >--- src/org/eclipse/hyades/test/ui/forms/util/EObjectTreeContentProvider.java 14 Oct 2005 15:26:03 -0000 1.1 >+++ src/org/eclipse/hyades/test/ui/forms/util/EObjectTreeContentProvider.java 26 Mar 2007 15:27:24 -0000 >@@ -38,8 +38,8 @@ > * @author bjiang > * @since 4.1 > */ >-public class EObjectTreeContentProvider extends AdapterImpl implements ITreeContentProvider { >- >+public class EObjectTreeContentProvider extends AdapterImpl implements ITreeContentProvider >+{ > private EStructuralFeature eStructuralFeature; > private EObject container; > private Viewer viewer; >Index: src/org/eclipse/hyades/test/ui/forms/base/LogEventsBlock.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src/org/eclipse/hyades/test/ui/forms/base/LogEventsBlock.java,v >retrieving revision 1.20 >diff -u -r1.20 LogEventsBlock.java >--- src/org/eclipse/hyades/test/ui/forms/base/LogEventsBlock.java 22 Mar 2007 14:42:04 -0000 1.20 >+++ src/org/eclipse/hyades/test/ui/forms/base/LogEventsBlock.java 26 Mar 2007 15:27:24 -0000 >@@ -29,6 +29,7 @@ > import org.eclipse.hyades.test.ui.forms.extensions.IEventAction; > import org.eclipse.hyades.test.ui.forms.util.FormsUtil; > import org.eclipse.hyades.test.ui.forms.util.TestLogEventsContentProvider; >+import org.eclipse.hyades.test.ui.forms.util.TestLogEventsLazyPathContentProvider; > import org.eclipse.hyades.test.ui.forms.util.TestLogVerdictCollection; > import org.eclipse.hyades.test.ui.internal.editor.form.util.EventLabelProvider; > import org.eclipse.hyades.test.ui.internal.editor.form.util.ExecutionHistoryExtensionsManager; >@@ -119,7 +120,7 @@ > layout.makeColumnsEqualWidth = false; > client.setLayout(layout); > >- Tree tree = toolkit.createTree(client, SWT.FULL_SELECTION | SWT.SINGLE); >+ Tree tree = toolkit.createTree(client, SWT.FULL_SELECTION | SWT.SINGLE | SWT.VIRTUAL); > GridData gd = new GridData(GridData.FILL_BOTH); > gd.grabExcessVerticalSpace = true; > gd.widthHint = 100; >@@ -127,8 +128,11 @@ > tree.setLayoutData(gd); > > viewer = new TreeViewer(tree); >- viewer.setContentProvider(new TestLogEventsContentProvider(Common_TestprofilePackage.eINSTANCE.getTPFExecutionHistory_ExecutionEvents())); >+ //viewer.setContentProvider(new TestLogEventsContentProvider(Common_TestprofilePackage.eINSTANCE.getTPFExecutionHistory_ExecutionEvents())); >+ viewer.setContentProvider(new TestLogEventsLazyPathContentProvider(Common_TestprofilePackage.eINSTANCE.getTPFExecutionHistory_ExecutionEvents())); > viewer.setLabelProvider(new EventLabelProvider()); >+ viewer.setUseHashlookup(true); >+ > viewer.addSelectionChangedListener(this); > TPFExecutionResult result = (TPFExecutionResult)((TestLogViewer)formPage.getEditor()).getEditorObject(); > >Index: src/org/eclipse/hyades/test/ui/forms/util/TestLogEventsLazyPathContentProvider.java >=================================================================== >RCS file: src/org/eclipse/hyades/test/ui/forms/util/TestLogEventsLazyPathContentProvider.java >diff -N src/org/eclipse/hyades/test/ui/forms/util/TestLogEventsLazyPathContentProvider.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/hyades/test/ui/forms/util/TestLogEventsLazyPathContentProvider.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,240 @@ >+/******************************************************************************* >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: TestLogEventsContentProvider.java,v 1.4 2005/10/14 15:26:03 bjiang Exp $ >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.hyades.test.ui.forms.util; >+ >+import java.util.Collection; >+ >+import org.eclipse.emf.ecore.EStructuralFeature; >+import org.eclipse.hyades.models.common.testprofile.TPFExecutionEvent; >+import org.eclipse.hyades.models.common.testprofile.TPFExecutionHistory; >+import org.eclipse.hyades.models.common.testprofile.TPFExecutionResult; >+import org.eclipse.hyades.models.common.testprofile.TPFInvocationEvent; >+import org.eclipse.jface.viewers.ILazyTreePathContentProvider; >+import org.eclipse.jface.viewers.TreePath; >+import org.eclipse.jface.viewers.TreeViewer; >+ >+/** >+ * This is the content provider used by TPTP Test Log Viewer Events tree. >+ * >+ * @author bjiang >+ * @author marcelop >+ * @since 4.1 >+ */ >+public class TestLogEventsLazyPathContentProvider extends EObjectTreeContentProvider >+ implements ILazyTreePathContentProvider >+{ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.hyades.test.ui.forms.util.EObjectContainerContentProvider#getRegisteredParentChild(java.lang.Object) >+ */ >+ protected Object getRegisteredParentChild(Object parent) >+ { >+ if(parent instanceof TPFExecutionResult) >+ { >+ TPFExecutionResult executionResult = (TPFExecutionResult)parent; >+ if(executionResult.getExecutionHistory() != null) >+ return executionResult.getExecutionHistory().getExecutionEvents(); >+ return null; >+ } >+ //added to set the parent/child hierarchy for execution events :BGB(12/2/03) >+ else if (parent instanceof TPFExecutionEvent) >+ { >+ if ( parent instanceof TPFInvocationEvent ) >+ { >+ TPFInvocationEvent invocationEvent = (TPFInvocationEvent)parent; >+ return( invocationEvent.getInvokedExecutionResult() ); >+ } >+ else >+ { >+ TPFExecutionEvent executionEvent = (TPFExecutionEvent)parent; >+ if ( ( executionEvent.getChildren() != null ) && >+ ( executionEvent.getChildren().isEmpty() == false )) >+ return( executionEvent.getChildren()); >+ } >+ } >+ return null; >+ } >+ >+ >+ public TestLogEventsLazyPathContentProvider(EStructuralFeature eStructuralFeature) >+ { >+ super(eStructuralFeature); >+ } >+ >+ public TreePath[] getParents(Object element) >+ { >+ return null; >+ } >+ >+ >+ /** >+ * Called when a previously-blank item becomes visible in the TreeViewer. >+ */ >+ public void updateElement(TreePath parentPath, int index) >+ { >+ >+ Object child = null; >+ Object parent = getElement(parentPath); >+ >+ if (parent instanceof TPFExecutionHistory) { >+ TPFExecutionHistory eventLog = (TPFExecutionHistory) parent; >+ child = (TPFExecutionEvent) eventLog.getExecutionEvents().get(index); >+ } >+ else if(parent instanceof TPFExecutionResult) >+ { >+ TPFExecutionResult executionResult = (TPFExecutionResult)parent; >+ if(executionResult.getExecutionHistory() != null) >+ child = executionResult.getExecutionHistory().getExecutionEvents().get(index); >+ } >+ >+ else if (parent instanceof TPFExecutionEvent) { >+ >+ if ( parent instanceof TPFInvocationEvent ) >+ { >+ >+ TPFInvocationEvent invocationEvent = (TPFInvocationEvent)parent; >+ child = invocationEvent.getInvokedExecutionResult(); >+ >+ } >+ else >+ { >+ TPFExecutionEvent executionEvent = (TPFExecutionEvent)parent; >+ if ( ( executionEvent.getChildren() != null ) && >+ ( executionEvent.getChildren().isEmpty() == false )) >+ child = (TPFExecutionEvent)executionEvent.getChildren().get(index); >+ } >+ >+ } >+ >+// System.out.println("update Element " + index + "\n " + parent + "\n " + child); >+ >+ if (child != null) { >+ >+ TreeViewer treeViewer = (TreeViewer)getViewer(); >+ >+ treeViewer.replace(parentPath, index, child); >+ >+ int count = 0; >+ Object child1 = getRegisteredParentChild(child); >+ if(child1 != null) >+ { >+ if(child1 instanceof Collection) >+ count = ((Collection)child1).size(); >+ else >+ count =1; >+ >+ } >+ >+ // System.out.println("update Element child " + child.getClass().getName() + ", " + count); >+ >+ treeViewer.setChildCount(child, count); >+ } >+ } >+ >+ /** >+ * Called when the TreeViewer needs an up-to-date child count for the given tree path >+ */ >+ public void updateChildCount(TreePath treePath, int currentChildCount) >+ { >+ >+ Object element = getElement(treePath); >+ >+ int count = currentChildCount; >+// System.out.println("updateChildCount " + element + ", " + currentChildCount); >+ >+ if(element instanceof TPFExecutionHistory) >+ { >+ count = ((TPFExecutionHistory)element).getExecutionEvents().size(); >+ } >+ else if(element instanceof TPFExecutionResult) >+ { >+ TPFExecutionResult executionResult = (TPFExecutionResult)element; >+ if(executionResult.getExecutionHistory() != null) >+ { >+ count = executionResult.getExecutionHistory().getExecutionEvents().size(); >+ } >+ } >+ else if (element instanceof TPFExecutionEvent) { >+ >+ if (!( element instanceof TPFInvocationEvent) ) >+ { >+ TPFExecutionEvent executionEvent = (TPFExecutionEvent)element; >+ if ( ( executionEvent.getChildren() != null ) && >+ ( executionEvent.getChildren().isEmpty() == false )) >+ count = executionEvent.getChildren().size(); >+ } >+ >+ } >+ >+// System.out.println("updateChildCount " + element + " : " + currentChildCount + ", " + count); >+ >+ if(count != currentChildCount) >+ ((TreeViewer)getViewer()).setChildCount(treePath, count); >+ >+ >+ } >+ >+ /** >+ * Called when the TreeViewer needs up-to-date information whether the node >+ * at the given tree path can be expanded. If the content provider knows the >+ * element at the given tree path, it should respond by calling >+ * {@link TreeViewer#setHasChildren(Object, boolean)}. The content provider >+ * may also choose to call {@link TreeViewer#setChildCount(Object, int)} >+ * instead if it knows the number of children. >+ */ >+ public void updateHasChildren(TreePath path) >+ { >+ Object element = getElement(path); >+ TreeViewer viewer = (TreeViewer)getViewer(); >+ >+// System.out.println("updatehasChildern " + element); >+ if(element instanceof TPFExecutionHistory) >+ { >+ viewer.setChildCount(path, ((TPFExecutionHistory)element).getExecutionEvents().size()); >+ } >+ else if(element instanceof TPFExecutionResult) >+ { >+ TPFExecutionResult executionResult = (TPFExecutionResult)element; >+ if(executionResult.getExecutionHistory() != null) >+ { >+ viewer.setChildCount(path, executionResult.getExecutionHistory().getExecutionEvents().size()); >+ } >+ } >+ else if (element instanceof TPFExecutionEvent) { >+ >+ if ( element instanceof TPFInvocationEvent) >+ { >+ viewer.setHasChildren(path, false); >+ } >+ else >+ { >+ TPFExecutionEvent executionEvent = (TPFExecutionEvent)element; >+ viewer.setHasChildren(path, executionEvent.getChildren() != null && executionEvent.getChildren().size() > 0); >+ >+ } >+ } >+ } >+ >+ /** >+ * Returns the element corresponding to the given tree path. >+ * >+ * @param path tree path >+ * @return model element >+ */ >+ protected Object getElement(TreePath path) { >+ if (path.getSegmentCount() > 0) { >+ return path.getLastSegment(); >+ } >+ return getViewer().getInput(); >+ } >+ >+ }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 179540
: 62103