use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class TermBaseSearchDialog method readDialogSettings.
private void readDialogSettings() {
IDialogSettings ids = getDialogSettings();
btnIsCaseSensitive.setSelection(ids.getBoolean("net.heartsome.cat.database.ui.tb.dialog.TermBaseSearchDialog.caseSensitive"));
// btnIsCaseSensitive.setSelection(preferenceStore.getBoolean(TBPreferenceConstants.TB_CASE_SENSITIVE));
btnIsIgnoreMark.setSelection(!ids.getBoolean("net.heartsome.cat.database.ui.tb.dialog.TermBaseSearchDialog.ignoreMark"));
btnApplyRegularExpression.setSelection(ids.getBoolean("net.heartsome.cat.database.ui.tb.dialog.TermBaseSearchDialog.regEx"));
try {
spiMatchQuality.setSelection(ids.getInt("net.heartsome.cat.database.ui.tb.dialog.TermBaseSearchDialog.matchQuality"));
} catch (NumberFormatException e) {
spiMatchQuality.setSelection(100);
}
String[] arrSearchHistory = ids.getArray("net.heartsome.cat.database.ui.tb.dialog.TermBaseSearchDialog.searchHistory");
if (arrSearchHistory != null) {
lstSearchHistory.clear();
for (int i = 0; i < arrSearchHistory.length; i++) {
lstSearchHistory.add(arrSearchHistory[i]);
}
}
String selTM = ids.get("net.heartsome.cat.database.ui.tb.dialog.TermBaseSearchDialog.selTM");
int selIndex = 0;
if (selTM != null) {
for (int i = 0; i < cmbDatabase.getItemCount(); i++) {
if (selTM.equals(cmbDatabase.getItem(i))) {
selIndex = i;
break;
}
}
}
cmbDatabase.select(selIndex);
String[] arrTarget = ids.getArray("net.heartsome.cat.database.ui.tb.dialog.TermBaseSearchDialog.selTgt");
List<String> lstSelItem = new ArrayList<String>();
if (arrTarget != null) {
for (int i = 0; i < menu.getItemCount(); i++) {
MenuItem item = menu.getItem(i);
for (String target : arrTarget) {
if (item.getText().equals(target)) {
item.setSelection(true);
break;
}
}
if (item.getSelection()) {
lstSelItem.add(item.getText());
}
}
}
// 重设表格列宽
int totalWidth = 0;
List<GridColumn> lstShowColumn = new ArrayList<GridColumn>();
for (int index = 0; index < grid.getColumnCount(); index++) {
GridColumn column = grid.getColumn(index);
if (column.getWidth() > 0) {
totalWidth += column.getWidth();
}
if (column.getWidth() > 0 || lstSelItem.indexOf(column.getText()) >= 0) {
lstShowColumn.add(column);
}
}
int width = (totalWidth + 100) / lstShowColumn.size();
for (GridColumn column : lstShowColumn) {
column.setWidth(width);
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class ConversionWizard method performFinish.
@Override
public boolean performFinish() {
IDialogSettings dialogSettings = Activator.getDefault().getDialogSettings();
dialogSettings.put(ConversionWizardPage.REPLACE_TARGET, page.isReplaceTarget());
dialogSettings.put(ConversionWizardPage.OPEN_PRE_TRANS, page.isOpenPreTrans());
return true;
}
use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class ExportProjectWizardPage method internalSaveWidgetValues.
/**
* Hook method for saving widget values for restoration by the next instance of this class.
*/
protected void internalSaveWidgetValues() {
super.internalSaveWidgetValues();
// update directory names history
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(STORE_DESTINATION_NAMES_ID);
if (directoryNames == null) {
directoryNames = new String[0];
}
directoryNames = addToHistory(directoryNames, getDestinationValue());
settings.put(STORE_DESTINATION_NAMES_ID, directoryNames);
settings.put(STORE_CREATE_STRUCTURE_ID, true);
settings.put(STORE_COMPRESS_CONTENTS_ID, true);
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class ExportProjectWizardPage method restoreWidgetValues.
/**
* Hook method for restoring widget values to the values that they held last time this wizard was used to
* completion.
*/
protected void restoreWidgetValues() {
super.restoreWidgetValues();
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(STORE_DESTINATION_NAMES_ID);
if (directoryNames == null || directoryNames.length == 0) {
// ie.- no settings stored
return;
}
// destination
setDestinationValue(directoryNames[0]);
// for (int i = 0; i < directoryNames.length; i++) {
// addDestinationItem(directoryNames[i]);
// }
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class ImportProjectWizardPage method saveWidgetValues.
/**
* Since Finish was pressed, write widget values to the dialog store so that
* they will persist into the next invocation of this wizard page.
*
* Method declared public only for use of tests.
*/
public void saveWidgetValues() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
settings.put(STORE_COPY_PROJECT_ID, true);
settings.put(STORE_ARCHIVE_SELECTED, true);
}
}
Aggregations