mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-11 11:05:24 +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();
|
fireLaunchTargetsChanged();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
fireLaunchTargetsChanged();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ import org.eclipse.swt.widgets.Event;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Listener;
|
import org.eclipse.swt.widgets.Listener;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
public abstract class CSelector extends Composite {
|
public abstract class CSelector extends Composite {
|
||||||
private IStructuredContentProvider contentProvider;
|
private IStructuredContentProvider contentProvider;
|
||||||
|
@ -557,7 +558,15 @@ public abstract class CSelector extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refresh() {
|
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) {
|
public void update(Object element) {
|
||||||
|
|
|
@ -108,6 +108,7 @@ public class LaunchBarControl implements Listener {
|
||||||
button.setImage(srcImage);
|
button.setImage(srcImage);
|
||||||
button.setToolTipText(toolTipText);
|
button.setToolTipText(toolTipText);
|
||||||
button.addSelectionListener(new SelectionAdapter() {
|
button.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@Override
|
||||||
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
|
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
|
||||||
Activator.runCommand(command);
|
Activator.runCommand(command);
|
||||||
};
|
};
|
||||||
|
@ -146,8 +147,7 @@ public class LaunchBarControl implements Listener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void launchTargetsChanged() {
|
public void launchTargetsChanged() {
|
||||||
// TODO Auto-generated method stub
|
targetSelector.refresh();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigSelector getConfigSelector() {
|
public ConfigSelector getConfigSelector() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue