use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class WizardFileSystemResourceExportPage2 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() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(STORE_DESTINATION_NAMES_ID);
if (directoryNames == null) {
// ie.- no settings stored
return;
}
// destination
setDestinationValue(directoryNames[0]);
// options
if (null != overwriteExistingFilesCheckbox) {
overwriteExistingFilesCheckbox.setSelection(settings.getBoolean(STORE_OVERWRITE_EXISTING_FILES_ID));
}
tmCheck.setSelection(settings.getBoolean(SELECT_TM_EXPORTED));
tbCheck.setSelection(settings.getBoolean(SELECT_TB_EXPORTED));
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class ExportDocxDialog method initRtfPath.
private void initRtfPath() {
IDialogSettings dialogSettings = Activator.getDefault().getDialogSettings();
String strRtfPath = dialogSettings.get(STORE_DOCX_PATH);
if (strRtfPath != null && !strRtfPath.trim().equals("")) {
docxPathTxt.setText(strRtfPath);
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class ImportDocxDialog method initRtfPath.
private void initRtfPath() {
IDialogSettings dialogSettings = Activator.getDefault().getDialogSettings();
String strRtfPath = dialogSettings.get(STORE_DOCX_PATH);
if (strRtfPath != null && !strRtfPath.trim().equals("")) {
docxPathTxt.setText(strRtfPath);
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class ConcordanceSearchDialog method readDialogSettings.
private void readDialogSettings() {
IDialogSettings ids = getDialogSettings();
String[] arrSearchHistory = ids.getArray("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.searchHistory");
if (arrSearchHistory != null) {
lstSearchHistory.clear();
for (int i = 0; i < arrSearchHistory.length; i++) {
lstSearchHistory.add(arrSearchHistory[i]);
}
}
btnIsCaseSensitive.setSelection(ids.getBoolean("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.caseSensitive"));
btnIsIgnoreMark.setSelection(!ids.getBoolean("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.ignoreMark"));
btnApplyRegularExpression.setSelection(ids.getBoolean("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.regEx"));
String selTB = ids.get("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.selTB");
int selIndex = 0;
if (selTB != null) {
for (int i = 0; i < cmbDatabase.getItemCount(); i++) {
if (selTB.equals(cmbDatabase.getItem(i))) {
selIndex = i;
break;
}
}
}
cmbDatabase.select(selIndex);
String[] arrTarget = ids.getArray("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.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());
}
}
}
List<IColumn> lstShowColumn = new ArrayList<IColumn>();
boolean blnIsResetWidth = false;
for (int index = 1; index < tableModel.getColumnCount(); index++) {
IColumn column = tableModel.getColumn(index);
int width = jTable.getTableViewState().getColumnWidth(column);
if (lstSelItem.indexOf(column.getHeaderLabel()) != -1 && width == 0) {
jTable.getTableViewState().setColumnVisible(column, true);
jTable.updateColumnList();
jTable.redraw();
lstShowColumn.add(column);
blnIsResetWidth = true;
} else if (width > 0) {
lstShowColumn.add(column);
}
}
if (blnIsResetWidth) {
int width = totalWidth / lstShowColumn.size() + 1;
for (int colNum = 1; colNum < jTable.getColumnCount(); colNum++) {
jTable.getTableViewState().setColumnWidth(jTable.getColumn(colNum), width);
}
}
cmpExpandableFilter.setExpanded(ids.getBoolean("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.isExpandFilter"));
try {
cmbSrcOrTgt.select(ids.getInt("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.selSrcOrTgt"));
} catch (NumberFormatException e) {
cmbSrcOrTgt.select(1);
}
try {
cmbContain.select(ids.getInt("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.contain"));
} catch (NumberFormatException e) {
cmbContain.select(1);
}
String[] arrFilterHistory = ids.getArray("net.heartsome.cat.database.ui.tm.dialog.ConcordanceSearchDialog.filterHistory");
if (arrFilterHistory != null) {
lstFilterHistory.clear();
for (int i = 0; i < arrFilterHistory.length; i++) {
lstFilterHistory.add(arrFilterHistory[i]);
}
}
layoutExpandable();
}
use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class ConcordanceSearchDialog method getDialogSettings.
private IDialogSettings getDialogSettings() {
IDialogSettings settings = Activator.getDefault().getDialogSettings();
IDialogSettings fDialogSettings = settings.getSection(getClass().getName());
if (fDialogSettings == null)
fDialogSettings = settings.addNewSection(getClass().getName());
return fDialogSettings;
}
Aggregations