use of org.eclipse.linuxtools.internal.docker.ui.wizards.ConfigureLabels in project linuxtools by eclipse.
the class ConfigureLabelsCommandHandler method execute.
@SuppressWarnings("unused")
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final ConfigureLabels wizard = new ConfigureLabels();
final boolean configureLabels = CommandUtils.openWizard(wizard, HandlerUtil.getActiveShell(event));
if (configureLabels) {
Map<String, String> labels = wizard.getConfigureLabels();
StringBuffer buffer = new StringBuffer();
for (Entry<String, String> entry : labels.entrySet()) {
buffer.append(entry.getKey());
// $NON-NLS-1$
buffer.append('=');
buffer.append(entry.getValue());
buffer.append('\u00a0');
}
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
preferences.put(CONTAINER_FILTER_LABELS, buffer.toString());
IDockerConnection connection = CommandUtils.getCurrentConnection(null);
// force refresh
connection.getContainers(true);
}
return null;
}
Aggregations