Package com.intellij.ide.util

Examples of com.intellij.ide.util.PropertiesComponent


    PropertiesComponent properties = PropertiesComponent.getInstance(project);
    return properties.getBoolean(LOMBOK_PLUGIN_ENABLED_IN_PROJECT_PROPERTY, DefaultSettings.PLUGIN_ENABLED_IN_PROJECT);
  }

  public static void setEnabledInProject(@NotNull final Project project, boolean value) {
    PropertiesComponent properties = PropertiesComponent.getInstance(project);
    properties.setValue(LOMBOK_PLUGIN_ENABLED_IN_PROJECT_PROPERTY, String.valueOf(value));

    project.putUserData(LOMBOK_ENABLED_KEY, value);
    //DaemonCodeAnalyser.getInstance(project).restart();
  }
View Full Code Here


    public String getComponentName() {
        return COMPONENT_NAME;
    }

    public void initComponent() {
        PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(project);
        server = propertiesComponent.getValue(RB__SERVER);
        username = propertiesComponent.getValue(RB__USERNAME);
        encodedPassword = propertiesComponent.getValue(RB__ENCODED_PASSWORD);
    }
View Full Code Here

    }

    public void apply() throws ConfigurationException {
        if (form != null) {
            form.getData(this);
            PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(this.project);
            propertiesComponent.setValue(RB__SERVER, server);
            propertiesComponent.setValue(RB__USERNAME, username);
            propertiesComponent.setValue(RB__ENCODED_PASSWORD, encodedPassword);
        }

    }
View Full Code Here

    super.addCurrentTextToHistory();
    PropertiesComponent.getInstance().setValue(myPropertyName, StringUtil.join(getHistory(), "\n"));
  }

  public void reset() {
    final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
    final String history = propertiesComponent.getValue(myPropertyName);
    if (history != null) {
      final String[] items = history.split("\n");
      ArrayList<String> result = new ArrayList<String>();
      for (String item : items) {
        if (item != null && item.length() > 0) {
View Full Code Here

    super.addCurrentTextToHistory();
    PropertiesComponent.getInstance().setValue(myPropertyName, StringUtil.join(getHistory(), "\n"));
  }

  public void reset() {
    final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
    final String history = propertiesComponent.getValue(myPropertyName);
    if (history != null) {
      final String[] items = history.split("\n");
      ArrayList<String> result = new ArrayList<String>();
      for (String item : items) {
        if (item != null && item.length() > 0) {
View Full Code Here

        if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)) {
            return;
        }
        PsiDocumentManager.getInstance(project).commitAllDocuments();

        final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
        final List<PsiFieldMember> fieldMembers = chooseFields(file, editor, project, propertiesComponent);
        if (fieldMembers == null || fieldMembers.isEmpty()) return;

        ApplicationManager.getApplication().runWriteAction(new Runnable() {
            CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project);
            PsiElementFactory psiElementFactory = JavaPsiFacade.getInstance(project).getElementFactory();

            @Override
            public void run() {
                PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
                PsiClass clazz = PsiTreeUtil.getParentOfType(element, PsiClass.class);

                PsiClass builderClass = clazz.findInnerClassByName(BUILDER_CLASS_NAME, false);
                if (builderClass == null) {
                    builderClass = (PsiClass) clazz.add(psiElementFactory.createClass(BUILDER_CLASS_NAME));

                    // builder classes are static and final
                    builderClass.getModifierList().setModifierProperty(PsiModifier.STATIC, true);
                    builderClass.getModifierList().setModifierProperty(PsiModifier.FINAL, true);
                }

                boolean finalSetters = propertiesComponent.getBoolean(PROP_FINALSETTERS, false);
                boolean newBuilderMethod = propertiesComponent.getBoolean(PROP_NEWBUILDERMETHOD, false);
                boolean copyConstructor = propertiesComponent.getBoolean(PROP_COPYCONSTRUCTOR, false);
                boolean withNotation = propertiesComponent.getBoolean(PROP_WITHNOTATION, false);

                StringBuilder constructorTakingBuilder = new StringBuilder();
                constructorTakingBuilder.append("private ").append(clazz.getName()).append("(").append(builderClass.getName()).append(" builder) {");

                for (PsiFieldMember member : fieldMembers) {
View Full Code Here

TOP

Related Classes of com.intellij.ide.util.PropertiesComponent

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.