Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.IDialogSettings


       
    /**
     * Return a dialog setting section for this dialog
     */
    private IDialogSettings getDialogSettings() {
        IDialogSettings settings = WorkbenchPlugin.getDefault()
                .getDialogSettings();
        IDialogSettings thisSettings = settings
                .getSection(getClass().getName());
        if (thisSettings == null)
            thisSettings = settings.addNewSection(getClass().getName());
        return thisSettings;
    }
View Full Code Here


    /** the workbench * */
    IWorkbench workbench;

    public IDataWizard() {
        // set up dialog settings
        IDialogSettings settings = CatalogUIPlugin.getDefault().getDialogSettings().getSection(
                SETTINGS);
        if (settings == null) {
            settings = CatalogUIPlugin.getDefault().getDialogSettings().addNewSection(SETTINGS);
        }
        setDialogSettings(settings);
View Full Code Here

        destText = new Text(comp, SWT.SINGLE | SWT.BORDER);
        destText.setToolTipText(tooltip);
        GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
        destText.setLayoutData(gridData);
        WorkflowWizard wizard2 = getWizard();
    IDialogSettings dialogSettings = wizard2.getDialogSettings();
    String previousLocation = dialogSettings.get(DIRECTORY_KEY);
        if (previousLocation != null) {
            destText.setText(previousLocation);
            getState().setExportDir(previousLocation);
        } else {
            destText.setText(getState().getExportDir());
View Full Code Here

    /**
     * Use the dialog store to restore widget values to the values that they
     * held last time this dialog was used to completion.
     */
    protected void restoreWidgetValues() {
        IDialogSettings settings = getDialogSettings();

        String[] expandedCategoryIds = settings
                .getArray(STORE_EXPANDED_CATEGORIES_ID);
        if (expandedCategoryIds == null)
            return;

        ArrayList<OperationCategory> categoriesToExpand = new ArrayList<OperationCategory>(expandedCategoryIds.length);
        for (int i = 0; i < expandedCategoryIds.length; i++) {
            OperationCategory category = opMenuFactory.findCategory(expandedCategoryIds[i]);
            if (category != null) // ie.- it still exists
                categoriesToExpand.add(category);
        }

        if (!categoriesToExpand.isEmpty())
            tree.setExpandedElements(categoriesToExpand.toArray());
       
        String selectedOperationID = settings.get(STORE_SELECTED_OPERATION_ID);
        if (selectedOperationID != null) {
            OpAction action = opMenuFactory.find(selectedOperationID);
            if (action != null) {
                tree.setSelection(new StructuredSelection(action), true);
            }
View Full Code Here

    /**
     * Since OK was pressed, write widget values to the dialog store so that
     * they will persist into the next invocation of this dialog
     */
    protected void saveWidgetValues() {
        IDialogSettings settings = getDialogSettings();

        // Collect the ids of the all expanded categories
        Object[] expandedElements = tree.getExpandedElements();
        String[] expandedCategoryIds = new String[expandedElements.length];
        for (int i = 0; i < expandedElements.length; ++i)
            expandedCategoryIds[i] = ((OperationCategory) expandedElements[i]).getId();

        // Save them for next time.
        settings.put(STORE_EXPANDED_CATEGORIES_ID, expandedCategoryIds);
       
        String selectedOperationID = ""; //$NON-NLS-1$
        if (opActions.length > 0) {
            // in the case of a multi-selection, it's probably less confusing
            // to store just the first rather than the whole multi-selection
            selectedOperationID = opActions[0].getId();
        }
        settings.put(STORE_SELECTED_OPERATION_ID, selectedOperationID);
    }
View Full Code Here

    /**
     * Return the dialog store to cache values into
     */
    protected IDialogSettings getDialogSettings() {
        IDialogSettings workbenchSettings = UiPlugin.getDefault()
                .getDialogSettings();
        IDialogSettings section = workbenchSettings
                .getSection(DIALOG_SETTING_SECTION_NAME);
        if (section == null)
            section = workbenchSettings
                    .addNewSection(DIALOG_SETTING_SECTION_NAME);
        return section;
View Full Code Here

    public String getElementName( Object item ) {
        return ((Charset)item).displayName();
    }
    @Override
    protected IDialogSettings getDialogSettings() {
        IDialogSettings settings = UiPlugin.getDefault().getDialogSettings();
        IDialogSettings section = settings.getSection("CharsetChange"); //$NON-NLS-1$
        if( section == null ){
            section = settings.addNewSection("CharsetChange"); //$NON-NLS-1$
        }
        return section;
    }
View Full Code Here

            this.savePassword.setSelection(false);
            this.host.setFocus();

            int index = previousConnections.getSelectionIndex();
            String item = previousConnections.getItem(index);
            IDialogSettings settings = (IDialogSettings) previousConnections.getData(item);
            if (settings != null) {
                previousConnections.remove(index);
                previousConnections.setData(item, null);
                settings.put(DELETED, true);
            }
           
            if(previousConnections.getItemCount()<=1){
                previousConnections.setVisible(false);
            }
View Full Code Here

        previousConnections.addListener(SWT.Selection, new Listener(){

            public void handleEvent( Event event ) {
                String item = previousConnections.getItem(previousConnections.getSelectionIndex());
                IDialogSettings settings = (IDialogSettings) previousConnections.getData(item);
                if (settings != null) {
                    String host = settings.get(HOST);
                    String port = settings.get(PORT);
                    String username = settings.get(USERNAME);
                    String password = settings.get(PASSWORD);
                    boolean savedPassword = settings.getBoolean(SAVE_PASSWORD);
                    populateWidgets(host, port, username, password, savedPassword );
                    UserHostPage.this.password.setFocus();
                }else{
                    populateWidgets("", defaultPort, "", "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                }
View Full Code Here

        }
        return string;
    }

    private void populatePreviousConnections( Combo previousConnections ) {
        IDialogSettings previous = getDialogSettings().getSection(PREVIOUS_CONNECTIONS);
        if (previous != null) {

            IDialogSettings[] sections = previous.getSections();
            Arrays.sort(sections, new Comparator<IDialogSettings>(){

                public int compare( IDialogSettings o1, IDialogSettings o2 ) {
                   
                    long time1 = o1.getLong(TIMESTAMP);
View Full Code Here

TOP

Related Classes of org.eclipse.jface.dialogs.IDialogSettings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.