Issue #2069 populate the procedures list dialog asynchronously
Change-Id: I770f87a9de4d73084ca8c022038597405e594766 Former-commit-id:a8b39e28c1
[formerly5c21ce0644
] [formerlya8b39e28c1
[formerly5c21ce0644
] [formerly3b442729e4
[formerly fe4d566519ff114d739777e0663d01b903a2c4ae]]] Former-commit-id:3b442729e4
Former-commit-id:fed71d1d30
[formerlyf87969c8cf
] Former-commit-id:30e32c167d
This commit is contained in:
parent
d4d3655726
commit
fece314774
1 changed files with 40 additions and 15 deletions
|
@ -19,6 +19,8 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.d2d.ui.dialogs.procedures;
|
||||
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
|
@ -32,6 +34,7 @@ import org.eclipse.swt.events.MouseListener;
|
|||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.graphics.Cursor;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
|
@ -39,6 +42,7 @@ import org.eclipse.swt.layout.RowData;
|
|||
import org.eclipse.swt.layout.RowLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
@ -52,6 +56,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
|||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.LocalizationUtil;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
|
||||
/**
|
||||
|
@ -175,7 +180,10 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
* @param mainComp
|
||||
*/
|
||||
protected void createTextComp(Composite mainComp) {
|
||||
Composite textComp = new Composite(mainComp, SWT.NONE);
|
||||
final Cursor cursor = getShell().getCursor();
|
||||
getShell().setCursor(
|
||||
Display.getCurrent().getSystemCursor(SWT.CURSOR_WAIT));
|
||||
final Composite textComp = new Composite(mainComp, SWT.NONE);
|
||||
textComp.setLayout(new GridLayout(1, true));
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.widthHint = 150;
|
||||
|
@ -227,24 +235,41 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
}
|
||||
});
|
||||
|
||||
fileTree = populateDataList(treeViewer);
|
||||
Job job = new Job("Populating procedures...") {
|
||||
protected org.eclipse.core.runtime.IStatus run(
|
||||
org.eclipse.core.runtime.IProgressMonitor monitor) {
|
||||
fileTree = populateDataList(treeViewer);
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
treeViewer
|
||||
.setContentProvider(new ProcedureTreeContentProvider(
|
||||
fileTree));
|
||||
treeViewer
|
||||
.setLabelProvider(new ProcedureTreeLabelProvider());
|
||||
treeViewer.setSorter(new ProcedureTreeSorter());
|
||||
|
||||
treeViewer
|
||||
.setContentProvider(new ProcedureTreeContentProvider(fileTree));
|
||||
treeViewer.setLabelProvider(new ProcedureTreeLabelProvider());
|
||||
treeViewer.setSorter(new ProcedureTreeSorter());
|
||||
// uncomment following function call to enable the right
|
||||
// click
|
||||
// context
|
||||
// menu
|
||||
// createContextMenu();
|
||||
|
||||
// uncomment following function call to enable the right click context
|
||||
// menu
|
||||
// createContextMenu();
|
||||
// it didn't seem to start with null, the string doesn't
|
||||
// actually mean
|
||||
// anything in this case
|
||||
treeViewer.setInput("kickstart");
|
||||
|
||||
// it didn't seem to start with null, the string doesn't actually mean
|
||||
// anything in this case
|
||||
treeViewer.setInput("kickstart");
|
||||
openUserInTreeViewer();
|
||||
|
||||
openUserInTreeViewer();
|
||||
|
||||
createExpandComp(textComp);
|
||||
createExpandComp(textComp);
|
||||
getShell().setCursor(cursor);
|
||||
}
|
||||
});
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
};
|
||||
job.schedule();
|
||||
}
|
||||
|
||||
private void createContextMenu() {
|
||||
|
|
Loading…
Add table
Reference in a new issue