diff --git a/src/com/dd/FoldingConfigurable.kt b/src/com/dd/FoldingConfigurable.kt deleted file mode 100755 index 443a21b..0000000 --- a/src/com/dd/FoldingConfigurable.kt +++ /dev/null @@ -1,72 +0,0 @@ -/* - * IdeaVim - Vim emulator for IDEs based on the IntelliJ platform - * Copyright (C) 2003-2014 The IdeaVim authors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.dd - -import com.intellij.openapi.options.Configurable -import com.intellij.openapi.options.ConfigurationException -import org.jetbrains.annotations.Nls -import javax.swing.JComponent -import javax.swing.JPanel -import javax.swing.JTextField - -/** - * @author skyrylyuk - */ -class FoldingConfigurable : Configurable { - - - private val mPanel = JPanel() - private val mHolderName = JTextField() - private val mPrefix: JTextField? = null - - @Nls - override fun getDisplayName(): String { - return "Android Folding" - } - - override fun getHelpTopic(): String? { - return null - } - - override fun createComponent(): JComponent? { - reset() - mHolderName.text = "Hello" - mPanel.add(mHolderName) - return mPanel - } - - override fun isModified(): Boolean { - return true - } - - @Throws(ConfigurationException::class) - override fun apply() { - // PropertiesComponent.getInstance().setValue(PREFIX, mPrefix.getText()); - // PropertiesComponent.getInstance().setValue(VIEWHOLDER_CLASS_NAME, mHolderName.getText()); - } - - override fun reset() { - // mPrefix.setText(Utils.getPrefix()); - // mHolderName.setText(Utils.getViewHolderClassName()); - } - - override fun disposeUIResources() { - - } -} diff --git a/src/com/dd/FoldingNode.java b/src/com/dd/FoldingNode.java new file mode 100644 index 0000000..f72c52c --- /dev/null +++ b/src/com/dd/FoldingNode.java @@ -0,0 +1,23 @@ +package com.dd; + +import com.intellij.ide.projectView.PresentationData; +import com.intellij.ide.projectView.ViewSettings; +import com.intellij.ide.projectView.impl.nodes.PsiFileNode; +import com.intellij.openapi.project.Project; +import com.intellij.psi.PsiFile; + +class FoldingNode extends PsiFileNode { + private String mName; + + public FoldingNode(Project project, PsiFile value, ViewSettings viewSettings, String shortName) { + super(project, value, viewSettings); + mName = shortName; + } + + @Override + protected void updateImpl(PresentationData presentationData) { + super.updateImpl(presentationData); + + presentationData.setPresentableText(mName); + } +} diff --git a/src/com/dd/FoldingNode.kt b/src/com/dd/FoldingNode.kt deleted file mode 100644 index 02c3070..0000000 --- a/src/com/dd/FoldingNode.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.dd - -import com.intellij.ide.projectView.PresentationData -import com.intellij.ide.projectView.ViewSettings -import com.intellij.ide.projectView.impl.nodes.PsiFileNode -import com.intellij.openapi.project.Project -import com.intellij.psi.PsiFile - -class FoldingNode(project: Project, value: PsiFile, viewSettings: ViewSettings, private val mName: String) : PsiFileNode(project, value, viewSettings) { - - override fun update(presentationData: PresentationData) { - super.update(presentationData) - - - presentationData.presentableText = mName - } -} diff --git a/src/com/dd/SettingConfigurable.java b/src/com/dd/SettingConfigurable.java index 214fb05..ea300d2 100644 --- a/src/com/dd/SettingConfigurable.java +++ b/src/com/dd/SettingConfigurable.java @@ -96,9 +96,9 @@ public boolean isModified() { @Override public void apply() throws ConfigurationException { - PropertiesComponent.getInstance().setValue(PREFIX_CUSTOM_USE, useCustomPatternCheckBox.isSelected()); + PropertiesComponent.getInstance().setValue(PREFIX_CUSTOM_USE, Boolean.valueOf(useCustomPatternCheckBox.isSelected()).toString()); PropertiesComponent.getInstance().setValue(PREFIX_PATTERN, customPattern.getText()); - PropertiesComponent.getInstance().setValue(PREFIX_HIDE, hideFoldingPrefix.isSelected()); + PropertiesComponent.getInstance().setValue(PREFIX_HIDE, Boolean.valueOf(hideFoldingPrefix.isSelected()).toString()); isModified = false; } @@ -108,7 +108,7 @@ public void reset() { final boolean customPrefix = PropertiesComponent.getInstance().getBoolean(PREFIX_CUSTOM_USE, false); useCustomPatternCheckBox.setSelected(customPrefix); customPattern.setEnabled(customPrefix); - customPattern.setText(PropertiesComponent.getInstance().getValue(PREFIX_PATTERN)); + customPattern.setText(PropertiesComponent.getInstance().getValue(PREFIX_PATTERN, DEFAULT_PATTERN_DOUBLE)); hideFoldingPrefix.getModel().setSelected(PropertiesComponent.getInstance().getBoolean(PREFIX_HIDE, false)); }