Package org.apache.cayenne.pref

Examples of org.apache.cayenne.pref.PreferenceDetail


    }

    protected static File projectFileFromPrefs() {
        // This must be run after the application has already been bootstrapped.  Otherwise, the returned
        // app instance will be null.
        PreferenceDetail autoLoadPref = Application.getInstance().getPreferenceDomain().getDetail(GeneralPreferences.AUTO_LOAD_PROJECT_PREFERENCE, true);
       
        if ((autoLoadPref != null) && (true == autoLoadPref.getBooleanProperty(GeneralPreferences.AUTO_LOAD_PROJECT_PREFERENCE))) {
            ModelerPreferences modelerPreferences = ModelerPreferences.getPreferences();
            Vector arr = modelerPreferences.getVector(ModelerPreferences.LAST_PROJ_FILES);

            return new File((String) arr.get(0));
        }
View Full Code Here


    protected void initView() {

        messagePanel = new JPanel(new BorderLayout());
        cardLayout = new CardLayout();
       
        PreferenceDetail detail = getDomain().
            getDetail(getDividerLocationProperty(), false);
       
        int defLocation = Application.getFrame().getHeight() / 2;
        int location = detail != null ?
                detail.getIntProperty(getDividerLocationProperty(), defLocation) : defLocation;

        /**
         * As of CAY-888 #3 main pane is now a JSplitPane.
         * Top component is a bit larger.
         */
 
View Full Code Here

     */
    public void propertyChange(PropertyChangeEvent evt) {
        if (JSplitPane.DIVIDER_LOCATION_PROPERTY.equals(evt.getPropertyName())) {
            int value = (Integer) evt.getNewValue();
           
            PreferenceDetail detail = getDomain().
                getDetail(getDividerLocationProperty(), true);
            detail.setIntProperty(getDividerLocationProperty(), value);
        }
    }
View Full Code Here

        Object selectedValue = pane.getValue();
        shouldDelete = selectedValue.equals(JOptionPane.YES_OPTION);

        // If the user clicks "no", we'll just ignore whatever's in the checkbox because it's non-sensical.
        if (shouldDelete) {
            PreferenceDetail pref = Application.getInstance().getPreferenceDomain().getDetail(GeneralPreferences.DELETE_PROMPT_PREFERENCE, true);
            pref.setBooleanProperty(GeneralPreferences.DELETE_PROMPT_PREFERENCE, neverPromptAgainBox.isSelected());
            Application.getInstance().getPreferenceService().savePreferences();
        }
    }
View Full Code Here

        return shouldDelete(String.format("%s named '%s'?", type, name));
    }

    public boolean shouldDelete(String name) {
        if (allowAsking) {
            PreferenceDetail pref = Application.getInstance().getPreferenceDomain().getDetail(GeneralPreferences.DELETE_PROMPT_PREFERENCE, true);

            // See if the user has opted not to showDialog the delete dialog.
            if ((pref == null) || (false == pref.getBooleanProperty(GeneralPreferences.DELETE_PROMPT_PREFERENCE))) {
                showDialog(name);
            }
        }

        return shouldDelete;
View Full Code Here

TOP

Related Classes of org.apache.cayenne.pref.PreferenceDetail

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.