mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
copyright: allow string separator (IDEA-89218)
This commit is contained in:
@@ -26,7 +26,7 @@ public class LanguageOptions implements JDOMExternalizable, Cloneable {
|
||||
|
||||
public static final int MIN_SEPARATOR_LENGTH = 5;
|
||||
public static final int MAX_SEPARATOR_LENGTH = 300;
|
||||
public static final char DEFAULT_FILLER = ' ';
|
||||
public static final String DEFAULT_FILLER = " ";
|
||||
|
||||
private static final LanguageOptions DEFAULT_SETTINGS_HOLDER = new LanguageOptions();
|
||||
|
||||
@@ -144,7 +144,7 @@ public class LanguageOptions implements JDOMExternalizable, Cloneable {
|
||||
result = 29 * result + lenBefore;
|
||||
result = 29 * result + lenAfter;
|
||||
result = 29 * result + (box ? 1 : 0);
|
||||
result = 29 * result + (int)filler;
|
||||
result = 29 * result + filler.hashCode();
|
||||
result = 29 * result + fileTypeOverride;
|
||||
result = 29 * result + (relativeBefore ? 1 : 0);
|
||||
result = 29 * result + (addBlankAfter ? 1 : 0);
|
||||
@@ -234,11 +234,11 @@ public class LanguageOptions implements JDOMExternalizable, Cloneable {
|
||||
this.box = box;
|
||||
}
|
||||
|
||||
public char getFiller() {
|
||||
public String getFiller() {
|
||||
return filler;
|
||||
}
|
||||
|
||||
public void setFiller(char filler) {
|
||||
public void setFiller(String filler) {
|
||||
this.filler = filler;
|
||||
}
|
||||
|
||||
@@ -262,6 +262,6 @@ public class LanguageOptions implements JDOMExternalizable, Cloneable {
|
||||
public int lenBefore;
|
||||
public int lenAfter;
|
||||
public boolean box;
|
||||
public char filler;
|
||||
public String filler;
|
||||
public boolean trim;
|
||||
}
|
||||
@@ -189,7 +189,7 @@
|
||||
</constraints>
|
||||
<properties>
|
||||
<labelFor value="679a0"/>
|
||||
<text value="Separator char"/>
|
||||
<text value="Separator"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="30865" class="javax.swing.JCheckBox" binding="cbBox">
|
||||
|
||||
@@ -251,7 +251,7 @@ public class TemplateCommentPanel implements SearchableConfigurable {
|
||||
|
||||
String filler = txtFiller.getText();
|
||||
if (filler.length() > 0) {
|
||||
res.setFiller(filler.charAt(0));
|
||||
res.setFiller(filler);
|
||||
}
|
||||
else {
|
||||
res.setFiller(LanguageOptions.DEFAULT_FILLER);
|
||||
@@ -399,7 +399,7 @@ public class TemplateCommentPanel implements SearchableConfigurable {
|
||||
cbSeparatorBefore.setSelected(options.isSeparateBefore());
|
||||
txtLengthBefore.setText(String.valueOf(options.getLenBefore()));
|
||||
txtLengthAfter.setText(String.valueOf(options.getLenAfter()));
|
||||
txtFiller.setText(options.getFiller() == LanguageOptions.DEFAULT_FILLER ? "" : Character.toString(options.getFiller()));
|
||||
txtFiller.setText(options.getFiller() == LanguageOptions.DEFAULT_FILLER ? "" : options.getFiller());
|
||||
cbBox.setSelected(options.isBox());
|
||||
|
||||
final int fileTypeOverride = options.getFileTypeOverride();
|
||||
|
||||
@@ -66,12 +66,12 @@ public class FileTypeUtil
|
||||
}
|
||||
|
||||
boolean allowSeparator = getInstance().allowSeparators(type);
|
||||
char filler = options.getFiller();
|
||||
String filler = options.getFiller();
|
||||
if (!allowSeparator)
|
||||
{
|
||||
if (options.getFiller() == LanguageOptions.DEFAULT_FILLER)
|
||||
{
|
||||
filler = '~';
|
||||
filler = "~";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class FileTypeUtil
|
||||
StringBuffer post = new StringBuffer(5);
|
||||
if (filler == LanguageOptions.DEFAULT_FILLER)
|
||||
{
|
||||
filler = open.charAt(open.length() - 1);
|
||||
filler = open.substring(open.length() - 1);
|
||||
}
|
||||
int offset = 0;
|
||||
if (isBlock)
|
||||
@@ -116,14 +116,14 @@ public class FileTypeUtil
|
||||
}
|
||||
if (!allowBlock)
|
||||
{
|
||||
close = Character.toString(filler);
|
||||
close = filler;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (allowLine)
|
||||
{
|
||||
close = Character.toString(filler);
|
||||
close = filler;
|
||||
}
|
||||
pre.append(open);
|
||||
post.append(close);
|
||||
|
||||
Reference in New Issue
Block a user