Search in sources :

Example 51 with IDialogSettings

use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.

the class ImportProjectWizardPage method restoreWidgetValues.

/**
	 * Use the dialog store to restore widget values to the values that they
	 * held last time this wizard was used to completion, or alternatively,
	 * if an initial path is specified, use it to select values.
	 * 
	 * Method declared public only for use of tests.
	 */
public void restoreWidgetValues() {
    // First, check to see if we have resore settings, and
    // take care of the checkbox
    IDialogSettings settings = getDialogSettings();
    if (settings != null) {
        // checkbox
        copyFiles = settings.getBoolean(STORE_COPY_PROJECT_ID);
        lastCopyFiles = copyFiles;
    } else // most relevant part (directory / archive name)
    if (initialPath != null) {
        boolean dir = new File(initialPath).isDirectory();
        if (!dir) {
            archivePathField.setText(initialPath);
            archivePathField.setSelection(initialPath.length());
        }
    }
}
Also used : IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) ZipFile(java.util.zip.ZipFile) TarFile(org.eclipse.ui.internal.wizards.datatransfer.TarFile) File(java.io.File)

Example 52 with IDialogSettings

use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.

the class KeysPreferencePage method getDialogSettings.

protected IDialogSettings getDialogSettings() {
    IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
    IDialogSettings settings = workbenchSettings.getSection(TAG_DIALOG_SECTION);
    if (settings == null) {
        settings = workbenchSettings.addNewSection(TAG_DIALOG_SECTION);
    }
    return settings;
}
Also used : IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings)

Example 53 with IDialogSettings

use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.

the class FindReplaceDialog 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;
}
Also used : IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings)

Example 54 with IDialogSettings

use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.

the class FindReplaceDialog method readDialogSettings.

private void readDialogSettings() {
    IDialogSettings ids = getDialogSettings();
    boolean blnDirection = ids.getBoolean("nattable.FindReplaceDialog.direction");
    forwardButton.setSelection(!blnDirection);
    backwardButton.setSelection(blnDirection);
    boolean blnRange = ids.getBoolean("nattable.FindReplaceDialog.range");
    sourceButton.setSelection(!blnRange);
    targetButton.setSelection(blnRange);
    caseSensitiveButton.setSelection(ids.getBoolean("nattable.FindReplaceDialog.caseSensitive"));
    wholeWordButton.setSelection(ids.getBoolean("nattable.FindReplaceDialog.wholeWord"));
    regExButton.setSelection(ids.getBoolean("nattable.FindReplaceDialog.regEx"));
    String[] arrFindHistory = ids.getArray("nattable.FindReplaceDialog.findHistory");
    if (arrFindHistory != null) {
        lstFindHistory.clear();
        for (int i = 0; i < arrFindHistory.length; i++) {
            lstFindHistory.add(arrFindHistory[i]);
        }
    }
    String[] arrReplaceHistory = ids.getArray("nattable.FindReplaceDialog.replaceHistory");
    if (arrReplaceHistory != null) {
        lstReplaceHistory.clear();
        for (int i = 0; i < arrReplaceHistory.length; i++) {
            lstReplaceHistory.add(arrReplaceHistory[i]);
        }
    }
}
Also used : IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) Point(org.eclipse.swt.graphics.Point)

Example 55 with IDialogSettings

use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.

the class FindReplaceDialog method getDialogBoundsSettings.

protected IDialogSettings getDialogBoundsSettings() {
    //$NON-NLS-1$
    String sectionName = getClass().getName() + "_dialogBounds";
    IDialogSettings settings = Activator.getDefault().getDialogSettings();
    IDialogSettings section = settings.getSection(sectionName);
    if (section == null)
        section = settings.addNewSection(sectionName);
    return section;
}
Also used : IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings)

Aggregations

IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)81 File (java.io.File)9 ArrayList (java.util.ArrayList)6 PersistenceException (org.talend.commons.exception.PersistenceException)6 Point (org.eclipse.swt.graphics.Point)5 Path (org.eclipse.core.runtime.Path)4 MenuItem (org.eclipse.swt.widgets.MenuItem)4 IPath (org.eclipse.core.runtime.IPath)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 GridData (org.eclipse.swt.layout.GridData)3 Combo (org.eclipse.swt.widgets.Combo)3 Composite (org.eclipse.swt.widgets.Composite)3 FileDialog (org.eclipse.swt.widgets.FileDialog)3 Widget (org.eclipse.swt.widgets.Widget)3 LocalFile (org.eclipse.core.internal.filesystem.local.LocalFile)2 IFile (org.eclipse.core.resources.IFile)2 CoreException (org.eclipse.core.runtime.CoreException)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 IJobChangeEvent (org.eclipse.core.runtime.jobs.IJobChangeEvent)2 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)2