Commit a59e5315 authored by cdelbe's avatar cdelbe
Browse files

PICKED FROM TRUNK 15037

SCHEDULING-525 Fixed authentication dialog popup.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/proactive/scheduling/branches/Scheduling_2.0.x@15115 28e8926c-6b08-0410-baaa-805c5e19b8d6
parent d0a5a4ca
...@@ -52,6 +52,7 @@ import org.eclipse.ui.part.ViewPart; ...@@ -52,6 +52,7 @@ import org.eclipse.ui.part.ViewPart;
import org.ow2.proactive.resourcemanager.gui.actions.CollapseAllAction; import org.ow2.proactive.resourcemanager.gui.actions.CollapseAllAction;
import org.ow2.proactive.resourcemanager.gui.actions.ExpandAllAction; import org.ow2.proactive.resourcemanager.gui.actions.ExpandAllAction;
import org.ow2.proactive.resourcemanager.gui.data.RMStore; import org.ow2.proactive.resourcemanager.gui.data.RMStore;
import org.ow2.proactive.resourcemanager.gui.handlers.ConnectHandler;
import org.ow2.proactive.resourcemanager.gui.tree.RMTreeViewer; import org.ow2.proactive.resourcemanager.gui.tree.RMTreeViewer;
import org.ow2.proactive.resourcemanager.gui.tree.TreeLabelProvider; import org.ow2.proactive.resourcemanager.gui.tree.TreeLabelProvider;
import org.ow2.proactive.resourcemanager.gui.tree.TreeSelectionListener; import org.ow2.proactive.resourcemanager.gui.tree.TreeSelectionListener;
...@@ -108,6 +109,12 @@ public class ResourceExplorerView extends ViewPart { ...@@ -108,6 +109,12 @@ public class ResourceExplorerView extends ViewPart {
if (RMStore.isConnected()) { if (RMStore.isConnected()) {
init(); init();
treeViewer.expandAll(); treeViewer.expandAll();
} else {
Display.getCurrent().asyncExec(new Runnable() {
public void run() {
ConnectHandler.getHandler().execute(Display.getDefault().getActiveShell());
}
});
} }
if (rmShell == null) { if (rmShell == null) {
......
...@@ -38,12 +38,16 @@ import org.eclipse.core.runtime.IStatus; ...@@ -38,12 +38,16 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator; import org.eclipse.jface.action.Separator;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.PartInitException; import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.ViewPart; import org.eclipse.ui.part.ViewPart;
import org.ow2.proactive.resourcemanager.gui.Activator; import org.ow2.proactive.resourcemanager.gui.Activator;
import org.ow2.proactive.resourcemanager.gui.compact.CompactViewer; import org.ow2.proactive.resourcemanager.gui.compact.CompactViewer;
import org.ow2.proactive.resourcemanager.gui.compact.Filter; import org.ow2.proactive.resourcemanager.gui.compact.Filter;
import org.ow2.proactive.resourcemanager.gui.data.RMStore;
import org.ow2.proactive.resourcemanager.gui.data.model.RMModel;
import org.ow2.proactive.resourcemanager.gui.handlers.ConnectHandler;
/** /**
...@@ -63,6 +67,14 @@ public class ResourcesCompactView extends ViewPart { ...@@ -63,6 +67,14 @@ public class ResourcesCompactView extends ViewPart {
public void createPartControl(Composite parent) { public void createPartControl(Composite parent) {
compactView = new CompactViewer(parent); compactView = new CompactViewer(parent);
if (!RMStore.isConnected()) {
Display.getCurrent().asyncExec(new Runnable() {
public void run() {
ConnectHandler.getHandler().execute(Display.getDefault().getActiveShell());
}
});
}
compactView.init(); compactView.init();
hookContextMenu(); hookContextMenu();
} }
......
...@@ -104,15 +104,16 @@ public class ResourcesTabView extends ViewPart { ...@@ -104,15 +104,16 @@ public class ResourcesTabView extends ViewPart {
table.setSortColumn(table.getColumn(1)); table.setSortColumn(table.getColumn(1));
hookContextMenu(); hookContextMenu();
tabViewer.addSelectionChangedListener(new TableSelectionListener()); tabViewer.addSelectionChangedListener(new TableSelectionListener());
if (RMStore.isConnected()) { if (RMStore.isConnected()) {
tabViewer.init(); tabViewer.init();
} else {
Display.getCurrent().asyncExec(new Runnable() {
public void run() {
ConnectHandler.getHandler().execute(Display.getDefault().getActiveShell());
}
});
} }
Display.getCurrent().asyncExec(new Runnable() {
public void run() {
ConnectHandler.getHandler().execute(Display.getDefault().getActiveShell());
}
});
} }
private void hookContextMenu() { private void hookContextMenu() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment