use of org.knime.core.data.ExtensibleUtilityFactory in project knime-core by knime.
the class ExtensibleUtilityFactoryTest method testNoRegisteredRenderers.
/**
* Tests basic functionality of the extension point.
*/
@Test
public void testNoRegisteredRenderers() {
ExtensibleUtilityFactory utilityFactory = Test2DataValue.UTILITY;
assertThat("Wrong utility factory retrieved via data type", DataType.getUtilityFor(Test2DataValue.class), is((UtilityFactory) utilityFactory));
Collection<DataValueRendererFactory> availableRenderers = utilityFactory.getAvailableRenderers();
assertThat("Wrong number of available renderers", availableRenderers.size(), is(0));
assertThat("Unexpected preferred renderer", utilityFactory.getPreferredRenderer(), is(IsNull.nullValue()));
}
use of org.knime.core.data.ExtensibleUtilityFactory in project knime-core by knime.
the class PreferenceInitializer method initializeDefaultPreferences.
/**
* {@inheritDoc}
*/
@Override
public void initializeDefaultPreferences() {
// get the preference store for the UI plugin
IPreferenceStore store = KNIMEUIPlugin.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.P_HIDE_TIPS_AND_TRICKS, false);
store.setDefault(PreferenceConstants.P_CONFIRM_RESET, true);
store.setDefault(PreferenceConstants.P_CONFIRM_DELETE, true);
store.setDefault(PreferenceConstants.P_CONFIRM_RECONNECT, true);
store.setDefault(PreferenceConstants.P_CONFIRM_EXEC_NODES_NOT_SAVED, true);
store.setDefault(PreferenceConstants.P_CONFIRM_LOAD_NIGHTLY_BUILD_WORKFLOW, true);
store.setDefault(PreferenceConstants.P_EXEC_NODES_DATA_AWARE_DIALOGS, MessageDialogWithToggle.PROMPT);
store.setDefault(PreferenceConstants.P_FAV_FREQUENCY_HISTORY_SIZE, 10);
store.setDefault(PreferenceConstants.P_FAV_LAST_USED_SIZE, 10);
store.setDefault(PreferenceConstants.P_DEFAULT_NODE_LABEL, "Node");
final Display defaultDisplay = Display.getDefault();
store.setDefault(PreferenceConstants.P_NODE_LABEL_FONT_SIZE, 8);
// run this async as there were strange exception on windows, even if in swt thread, see bug 6401
defaultDisplay.asyncExec(new Runnable() {
@Override
public void run() {
Font systemFont = defaultDisplay.getSystemFont();
FontData[] systemFontData = systemFont.getFontData();
if (systemFontData.length >= 1) {
store.setDefault(PreferenceConstants.P_NODE_LABEL_FONT_SIZE, systemFontData[0].getHeight());
}
}
});
store.setDefault(PreferenceConstants.P_META_NODE_LINK_UPDATE_ON_LOAD, MessageDialogWithToggle.PROMPT);
store.setDefault(PreferenceConstants.P_GRID_SHOW, Boolean.TRUE);
store.setDefault(PreferenceConstants.P_GRID_SNAP_TO, Boolean.TRUE);
store.setDefault(PreferenceConstants.P_GRID_SIZE_X, PreferenceConstants.P_GRID_DEFAULT_SIZE_X);
store.setDefault(PreferenceConstants.P_GRID_SIZE_Y, PreferenceConstants.P_GRID_DEFAULT_SIZE_Y);
store.setDefault(PreferenceConstants.P_CURVED_CONNECTIONS, PreferenceConstants.P_DEFAULT_CURVED_CONNECTIONS);
store.setDefault(PreferenceConstants.P_CONNECTIONS_LINE_WIDTH, PreferenceConstants.P_DEFAULT_CONNECTION_LINE_WIDTH);
store.setDefault(PreferenceConstants.P_AUTO_SAVE_ENABLE, PreferenceConstants.P_AUTO_SAVE_DEFAULT_ENABLE);
store.setDefault(PreferenceConstants.P_AUTO_SAVE_INTERVAL, PreferenceConstants.P_AUTO_SAVE_DEFAULT_INTERVAL_SECS);
store.setDefault(PreferenceConstants.P_AUTO_SAVE_DATA, PreferenceConstants.P_AUTO_SAVE_DEFAULT_WITH_DATA);
store.setDefault(PreferenceConstants.P_WRAP_TABLE_HEADER, PreferenceConstants.P_WRAP_TABLE_HEADER_DEFAULT);
store.setDefault(PreferenceConstants.P_ANNOTATION_BORDER_SIZE, PreferenceConstants.P_ANNOTATION_BORDER_SIZE_DEFAULT);
// this loads all registered renderers and initializes the default value
for (ExtensibleUtilityFactory fac : ExtensibleUtilityFactory.getAllFactories()) {
// this sets the default preference for the renderer for this data type
fac.getDefaultRenderer();
}
TableStoreFormatRegistry.getInstance().getDefaultTableStoreFormat();
}
Aggregations