use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.
the class DefinitionLabelProvider method dispose.
/**
* @see BaseLabelProvider#dispose()
*/
@Override
public void dispose() {
if (styleListener != null) {
StyleService styles = PlatformUI.getWorkbench().getService(StyleService.class);
styles.removeListener(styleListener);
}
images.dispose();
super.dispose();
}
use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.
the class SpectrumColorSchemeHandler method execute.
/**
* @see IHandler#execute(ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// collect all types
SetMultimap<DataSet, TypeDefinition> types = HashMultimap.create();
SchemaService schemas = PlatformUI.getWorkbench().getService(SchemaService.class);
for (TypeDefinition type : schemas.getSchemas(SchemaSpaceID.SOURCE).getMappingRelevantTypes()) {
types.put(DataSet.SOURCE, type);
}
for (TypeDefinition type : schemas.getSchemas(SchemaSpaceID.TARGET).getMappingRelevantTypes()) {
types.put(DataSet.TRANSFORMED, type);
}
Style style = StyleHelper.getSpectrumStyles(types);
StyleService styleService = PlatformUI.getWorkbench().getService(StyleService.class);
styleService.addStyles(style);
return null;
}
use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.
the class TypeRandomColorHandler method execute.
/**
* @see IHandler#execute(ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// collect types and associated data sets
SetMultimap<DataSet, TypeDefinition> types = TypeStyleHandler.collectTypesFromSelection(event);
Style style = StyleHelper.getRandomStyles(types);
StyleService styleService = PlatformUI.getWorkbench().getService(StyleService.class);
styleService.addStyles(style);
return null;
}
use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.
the class LoadStyle method handleResults.
/**
* @see AbstractIOAdvisor#handleResults(IOProvider)
*/
@Override
public void handleResults(StyleReader provider) {
StyleService ss = getService(StyleService.class);
ss.addStyles(provider.getStyles());
super.handleResults(provider);
}
use of eu.esdihumboldt.hale.ui.common.service.style.StyleService in project hale by halestudio.
the class StyledInstanceMarker method getStyle.
/**
* Get the style for a given way-point.
*
* @param context the way-point
* @return the style
*/
private Style getStyle(InstanceWaypoint context) {
StyleService ss = PlatformUI.getWorkbench().getService(StyleService.class);
InstanceReference ref = context.getValue();
return ss.getStyle(context.getInstanceType(), ref.getDataSet());
}
Aggregations