Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Removed some old task flags and updated some documentation and notes in
Browse files Browse the repository at this point in the history
the code.

Changed one reference to getSite().getPage().addSelectionListener(...)
to use
getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(...)
to make sure the SelectionService is used.

Signed-off-by: Jordan Deyton <deytonjh@ornl.gov>
  • Loading branch information
Jordan Deyton committed Apr 14, 2015
1 parent 4253fe1 commit 54bd5a4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ public class ICEFormEditor extends SharedHeaderFormEditor implements
/**
* This class' ICEFormPage that displays the MeshEditor powered by JME3.
*/
// TODO Add to model if necessary.
protected ICEMeshPage meshPage;

/**
Expand Down Expand Up @@ -406,7 +405,6 @@ private ICEFormPage createGeometryPage() {
*
* @return The MeshPage created.
*/
// TODO Add to model if necessary.
private ICEFormPage createMeshPage() {

// Local Declarations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,12 @@
*/
public class ICEResourcePage extends ICEFormPage implements ISelectionListener,
IUpdateableListener {

/**
* The ResourceComponent drawn by this page.
*/
private ResourceComponent resourceComponent;

/**
* The ICEResourceView that holds resources for this page to display.
*/
private ICEResourceView resourceView;

/**
* The workbench page used by this ICEResourcePage.
*/
Expand Down Expand Up @@ -164,23 +159,19 @@ protected void createFormContent(IManagedForm managedForm) {
} catch (PartInitException e) {
e.printStackTrace();
}
// Get the Resource View and set its content to this page's
// ResourceComponent.
resourceView = (ICEResourceView) getSite().getWorkbenchWindow()
.getActivePage().findView(ICEResourceView.ID);

// Get the parent Composite for the Resource Page widgets and set its
// layout to the StackLayout.
pageComposite = managedForm.getForm().getBody();
pageComposite.setLayout(stackLayout);

// Register the page as a selection listener. The page returned by
// getPage() is not the same as this page! There are some subtle UI
// differences under the hood.
getSite().getPage().addSelectionListener(this);
// Add a dispose event listener on the parent. If disposed at any point,
// remove it from the workbench's SelectionService listeners (or else it
// will attempt to refresh disposed widgets).
// Register the page with the SelectionService as a listener. Note that
// this call can be updated to only listen for selections from a
// particular part.
getSite().getWorkbenchWindow().getSelectionService()
.addSelectionListener(this);
// If the page is disposed, then this should be removed as a selection
// listener.
pageComposite.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent event) {
Expand Down Expand Up @@ -550,8 +541,9 @@ public void update(IUpdateable component) {
// Get a local copy of the ResouceComponent.
ResourceComponent resourceComponent = (ResourceComponent) component;

// TODO Remove any IPlots associated with VizResources that are no
// longer available.
// TODO Do we want to remove any IPlots associated with VizResources
// that are no longer available, or should we just let the user
// close them out?

// Create plots for any VizResources in the ResourceComponent that
// do not already have plots.
Expand All @@ -569,9 +561,17 @@ public void update(IUpdateable component) {

return;
}


/*
* (non-Javadoc)
*
* @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
* IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
// Do nothing
// This method should be used if we need to respond to the current
// selection. Note that the current selection can change based on the
// currently active view/part.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,10 @@ public void visit(ResourceComponent component) {
.getForm();
for (Component i : activeForm.getComponents()) {
i.accept(visitor);
// TODO We should actually show all resources rather than just
// those in the last ResourceComponent!
// // Exit the loop when the first ResourceComponent is found.
// if (componentRef.get() != null) {
// break;
// }
// Exit the loop when the first ResourceComponent is found.
if (componentRef.get() != null) {
break;
}
}
// --------------------------------------------------------- //

Expand All @@ -224,10 +222,6 @@ public void visit(ResourceComponent component) {
setResourceComponent(componentRef.get());
}

// TODO We would like to call ICEResourcePage#selectionChanged here
// to update the browser, but a solution to this has not been found
// yet.

// Set the reference to the new active editor and its resource page.
editor = activeEditor;
resourcePage = editor.getResourcePage();
Expand Down

0 comments on commit 54bd5a4

Please sign in to comment.