public boolean performOk() { int maxRowValue = noLimitBtn.getSelection() ? DATASET_DISPLAY_ALL_ROW : txtMaxDataSetRow.getIntValue(); ViewerPlugin.getDefault().getPluginPreferences().setValue(PREVIEW_MAXROW, maxRowValue); ViewerPlugin.getDefault() .getPluginPreferences() .setValue(PREVIEW_MAX_ROW_LEVEL_MEMBER, txtMaxRowLevelMember.getIntValue()); ViewerPlugin.getDefault() .getPluginPreferences() .setValue(PREVIEW_MAX_COLUMN_LEVEL_MEMBER, txtMaxColumnLevelMember.getIntValue()); ViewerPlugin.getDefault() .getPluginPreferences() .setValue(PREVIEW_MAX_IN_MEMORY_CUBE_SIZE, txtMaxInMemoryCubeSize.getIntValue()); ViewerPlugin.getDefault().savePluginPreferences(); return super.performOk(); }
private void initControlValues() { String defaultMaxRow = ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAXROW); if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) { defaultMaxRow = String.valueOf(MAX_DATASET_ROW_DEFAULT); } boolean previewAllRows = String.valueOf(DATASET_DISPLAY_ALL_ROW).equals(defaultMaxRow.trim()); noLimitBtn.setSelection(previewAllRows); txtMaxDataSetRow.setEnabled(!previewAllRows, noLimitBtn.getParent()); txtMaxDataSetRow.setStringValue(previewAllRows ? "" : defaultMaxRow); defaultMaxRow = ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAX_ROW_LEVEL_MEMBER); if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) { defaultMaxRow = String.valueOf(MAX_CUBE_ROW_LEVEL_MEMBER_DEFAULT); } txtMaxRowLevelMember.setStringValue(defaultMaxRow); defaultMaxRow = ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAX_COLUMN_LEVEL_MEMBER); if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) { defaultMaxRow = String.valueOf(MAX_CUBE_COLUMN_LEVEL_MEMBER_DEFAULT); } txtMaxColumnLevelMember.setStringValue(defaultMaxRow); defaultMaxRow = ViewerPlugin.getDefault().getPluginPreferences().getString(PREVIEW_MAX_IN_MEMORY_CUBE_SIZE); if (defaultMaxRow == null || defaultMaxRow.trim().length() <= 0) { defaultMaxRow = String.valueOf(MAX_IN_MEMORY_CUBE_SIZE_DEFAULT); } txtMaxInMemoryCubeSize.setStringValue(defaultMaxRow); }