private Label mDescriptionLabel;\r
\r
\r
-\r
/**\r
* Create the composite.\r
* @param parent The parent of the composite.\r
* @param updaterData An instance of {@link UpdaterData}. If null, a local\r
* one will be allocated just to help with the SWT Designer.\r
+ * @param updaterWindow The parent window.\r
*/\r
- public RemotePackagesPage(UpdaterWindowImpl updaterWindow,\r
- Composite parent,\r
- UpdaterData updaterData) {\r
+ RemotePackagesPage(Composite parent,\r
+ UpdaterData updaterData,\r
+ UpdaterWindowImpl updaterWindow) {\r
super(parent, SWT.BORDER);\r
mUpdaterWindow = updaterWindow;\r
\r
// Hide everything down-below from SWT designer\r
//$hide>>$\r
\r
+ /**\r
+ * Must be called once to set the adapter input for the sources tree viewer.\r
+ */\r
+ public void setInput(RepoSourcesAdapter sources) {\r
+ mTreeViewerSources.setContentProvider(sources.getContentProvider());\r
+ mTreeViewerSources.setLabelProvider( sources.getLabelProvider());\r
+ mTreeViewerSources.setInput(sources);\r
+ onTreeSelected();\r
+ }\r
+\r
+ /**\r
+ * Called by the constructor right after {@link #createContents(Composite)}.\r
+ */\r
private void postCreate() {\r
adjustColumnsWidth();\r
}\r
\r
-\r
/**\r
* Adds a listener to adjust the columns width when the parent is resized.\r
* <p/>\r
});\r
}\r
\r
- public void setInput(RepoSourcesAdapter sources) {\r
- mTreeViewerSources.setContentProvider(sources.getContentProvider());\r
- mTreeViewerSources.setLabelProvider( sources.getLabelProvider());\r
- mTreeViewerSources.setInput(sources);\r
- onTreeSelected();\r
- }\r
-\r
+ /**\r
+ * Called when an item in the package table viewer is selected.\r
+ * If the items is an {@link IDescription} (as it should), this will display its long\r
+ * description in the description area. Otherwise when the item is not of the expected\r
+ * type or there is no selection, it empties the description area.\r
+ */\r
private void onTreeSelected() {\r
ISelection sel = mTreeViewerSources.getSelection();\r
if (sel instanceof ITreeSelection) {\r