mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-05 16:15:25 +02:00
launchbar: fixed refresh of connection status on toolbar
- when we show icon with connection status it does not refresh automatically because launchbar does not propogate connection change events. Fixed that. Change-Id: I00c580d303460f6ead3a2aa3a91e8f151fd9f38a
This commit is contained in:
parent
3c10977fd9
commit
ce54f54a33
3 changed files with 13 additions and 3 deletions
|
@ -868,6 +868,7 @@ public class LaunchBarManager implements ILaunchBarManager, IRemoteConnectionCha
|
|||
fireLaunchTargetsChanged();
|
||||
break;
|
||||
default:
|
||||
fireLaunchTargetsChanged();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ import org.eclipse.swt.widgets.Event;
|
|||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
public abstract class CSelector extends Composite {
|
||||
private IStructuredContentProvider contentProvider;
|
||||
|
@ -557,7 +558,15 @@ public abstract class CSelector extends Composite {
|
|||
}
|
||||
|
||||
public void refresh() {
|
||||
// TODO add any new ones to the popup if it's open
|
||||
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
update(selection); // update current selection - name or icon may have changed
|
||||
if (popup != null && !popup.isDisposed()) {
|
||||
listViewer.refresh(true); // update all labels in the popup
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void update(Object element) {
|
||||
|
|
|
@ -108,6 +108,7 @@ public class LaunchBarControl implements Listener {
|
|||
button.setImage(srcImage);
|
||||
button.setToolTipText(toolTipText);
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
|
||||
Activator.runCommand(command);
|
||||
};
|
||||
|
@ -146,8 +147,7 @@ public class LaunchBarControl implements Listener {
|
|||
|
||||
@Override
|
||||
public void launchTargetsChanged() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
targetSelector.refresh();
|
||||
}
|
||||
|
||||
public ConfigSelector getConfigSelector() {
|
||||
|
|
Loading…
Add table
Reference in a new issue