mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
Cleanup (typos; formatting)
GitOrigin-RevId: 9733aeebbae11f645b17261f25692b92557ccd3a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fb5023db6b
commit
ac742921c5
@@ -18,12 +18,12 @@ public class PsiClassControl extends JavaControlBase<PsiClassPanel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected EditorTextField getEditorTextField(final @NotNull PsiClassPanel component) {
|
protected EditorTextField getEditorTextField(@NotNull PsiClassPanel component) {
|
||||||
return ((ReferenceEditorWithBrowseButton)component.getComponent(0)).getEditorTextField();
|
return ((ReferenceEditorWithBrowseButton)component.getComponent(0)).getEditorTextField();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PsiClassPanel createMainComponent(PsiClassPanel boundedComponent, final Project project) {
|
protected PsiClassPanel createMainComponent(PsiClassPanel boundedComponent, Project project) {
|
||||||
if (boundedComponent == null) {
|
if (boundedComponent == null) {
|
||||||
boundedComponent = new PsiClassPanel();
|
boundedComponent = new PsiClassPanel();
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ public class PsiClassControl extends JavaControlBase<PsiClassPanel> {
|
|||||||
PsiCodeFragmentImpl fragment = (PsiCodeFragmentImpl) PsiDocumentManager.getInstance(project).getPsiFile(document);
|
PsiCodeFragmentImpl fragment = (PsiCodeFragmentImpl) PsiDocumentManager.getInstance(project).getPsiFile(document);
|
||||||
assert fragment != null;
|
assert fragment != null;
|
||||||
fragment.setIntentionActionsFilter(IntentionFilterOwner.IntentionActionsFilter.EVERYTHING_AVAILABLE);
|
fragment.setIntentionActionsFilter(IntentionFilterOwner.IntentionActionsFilter.EVERYTHING_AVAILABLE);
|
||||||
fragment.putUserData(ModuleUtil.KEY_MODULE, getDomWrapper().getExistingDomElement().getModule());
|
fragment.putUserData(ModuleUtilCore.KEY_MODULE, getDomWrapper().getExistingDomElement().getModule());
|
||||||
return initReferenceEditorWithBrowseButton(boundedComponent, editor, this);
|
return initReferenceEditorWithBrowseButton(boundedComponent, editor, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,22 +20,21 @@ public class PsiTypeControl extends JavaControlBase<PsiTypePanel> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected @NotNull String getValue() {
|
protected @NotNull String getValue() {
|
||||||
final String rawValue = super.getValue();
|
String rawValue = super.getValue();
|
||||||
try {
|
try {
|
||||||
final PsiType psiType = JavaPsiFacade.getElementFactory(getProject()).createTypeFromText(rawValue, null);
|
PsiType psiType = JavaPsiFacade.getElementFactory(getProject()).createTypeFromText(rawValue, null);
|
||||||
final String s = JvmPsiTypeConverterImpl.convertToString(psiType);
|
String s = JvmPsiTypeConverterImpl.convertToString(psiType);
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IncorrectOperationException ignored) {
|
catch (IncorrectOperationException ignored) { }
|
||||||
}
|
|
||||||
return rawValue;
|
return rawValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setValue(String value) {
|
protected void setValue(String value) {
|
||||||
final PsiType type = JvmPsiTypeConverterImpl.convertFromString(value, new AbstractConvertContext() {
|
PsiType type = JvmPsiTypeConverterImpl.convertFromString(value, new AbstractConvertContext() {
|
||||||
@Override
|
@Override
|
||||||
public @NotNull DomElement getInvocationElement() {
|
public @NotNull DomElement getInvocationElement() {
|
||||||
return getDomElement();
|
return getDomElement();
|
||||||
@@ -48,12 +47,12 @@ public class PsiTypeControl extends JavaControlBase<PsiTypePanel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected EditorTextField getEditorTextField(final @NotNull PsiTypePanel component) {
|
protected EditorTextField getEditorTextField(@NotNull PsiTypePanel component) {
|
||||||
return ((ReferenceEditorWithBrowseButton)component.getComponent(0)).getEditorTextField();
|
return ((ReferenceEditorWithBrowseButton)component.getComponent(0)).getEditorTextField();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PsiTypePanel createMainComponent(PsiTypePanel boundedComponent, final Project project) {
|
protected PsiTypePanel createMainComponent(PsiTypePanel boundedComponent, Project project) {
|
||||||
if (boundedComponent == null) {
|
if (boundedComponent == null) {
|
||||||
boundedComponent = new PsiTypePanel();
|
boundedComponent = new PsiTypePanel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ checkbox.use.throws.rather.than.exception=Use @throws rather than @exception
|
|||||||
checkbox.warn.if.only.foreach.replacement.is.available=Warn if only 'forEach' replacement is available
|
checkbox.warn.if.only.foreach.replacement.is.available=Warn if only 'forEach' replacement is available
|
||||||
checkbox.warn.if.the.loop.is.trivial=Warn if the loop is trivial
|
checkbox.warn.if.the.loop.is.trivial=Warn if the loop is trivial
|
||||||
checkbox.wrap.at.right.margin=Wrap at right margin
|
checkbox.wrap.at.right.margin=Wrap at right margin
|
||||||
choose.class=Choose class
|
choose.class=Choose Class
|
||||||
chooser.text.choose.where.to.save.0=Choose where to save ''{0}''
|
chooser.text.choose.where.to.save.0=Choose where to save ''{0}''
|
||||||
chooser.title.select.path.to.save.jar=Select Path to Save Jar
|
chooser.title.select.path.to.save.jar=Select Path to Save Jar
|
||||||
class.decorator.or.has.default.constructor=''{0}'' should have default constructor or implement ''Decorator'' pattern
|
class.decorator.or.has.default.constructor=''{0}'' should have default constructor or implement ''Decorator'' pattern
|
||||||
@@ -1932,4 +1932,4 @@ intention.name.delete.method.title=Delete Method ''{0}()''
|
|||||||
intention.name.delete.method.with.callees=... along with other private methods used only there
|
intention.name.delete.method.with.callees=... along with other private methods used only there
|
||||||
intention.name.delete.method.only=... and nothing else
|
intention.name.delete.method.only=... and nothing else
|
||||||
intention.family.name.delete.private.method=Delete private method
|
intention.family.name.delete.private.method=Delete private method
|
||||||
checkbox.check.for.jdk.updates=Check for JDK updates
|
checkbox.check.for.jdk.updates=Check for JDK updates
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.codeInsight.inspections.shared
|
package org.jetbrains.kotlin.idea.codeInsight.inspections.shared
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ class NamingConventionInspectionSettings(
|
|||||||
setNamePatternCallback.invoke(value)
|
setNamePatternCallback.invoke(value)
|
||||||
nameRegex = try {
|
nameRegex = try {
|
||||||
value.toRegex()
|
value.toRegex()
|
||||||
} catch (e: PatternSyntaxException) {
|
} catch (_: PatternSyntaxException) {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,10 +160,6 @@ sealed class NamingConventionInspection(
|
|||||||
namingSettings.verifyName(element, holder, additionalCheck, rules)
|
namingSettings.verifyName(element, holder, additionalCheck, rules)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun getNameMismatchMessage(name: String): String {
|
|
||||||
return namingSettings.getNameMismatchMessage(name, rules)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getOptionsPane(): OptPane = namingSettings.getOptionsPane()
|
override fun getOptionsPane(): OptPane = namingSettings.getOptionsPane()
|
||||||
|
|
||||||
override fun getOptionController(): OptionController = namingSettings.getOptionController()
|
override fun getOptionController(): OptionController = namingSettings.getOptionController()
|
||||||
@@ -511,4 +507,4 @@ class PackageNameInspection : BaseGlobalInspection() {
|
|||||||
override fun getSharedLocalInspectionTool(): LocalInspectionTool {
|
override fun getSharedLocalInspectionTool(): LocalInspectionTool {
|
||||||
return PackageNameInspectionLocal(this, namingSettings)
|
return PackageNameInspectionLocal(this, namingSettings)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||||
package com.intellij.util.xml.ui;
|
package com.intellij.util.xml.ui;
|
||||||
|
|
||||||
import com.intellij.lang.annotation.HighlightSeverity;
|
import com.intellij.lang.annotation.HighlightSeverity;
|
||||||
@@ -37,6 +37,7 @@ public abstract class EditorTextFieldControl<T extends JComponent> extends BaseM
|
|||||||
throw new UnsupportedOperationException("Shouldn't be shown");
|
throw new UnsupportedOperationException("Shouldn't be shown");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private final boolean myCommitOnEveryChange;
|
private final boolean myCommitOnEveryChange;
|
||||||
private final DocumentListener myListener = new DocumentListener() {
|
private final DocumentListener myListener = new DocumentListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -48,13 +49,12 @@ public abstract class EditorTextFieldControl<T extends JComponent> extends BaseM
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected EditorTextFieldControl(final DomWrapper<String> domWrapper, final boolean commitOnEveryChange) {
|
protected EditorTextFieldControl(DomWrapper<String> domWrapper, boolean commitOnEveryChange) {
|
||||||
super(domWrapper);
|
super(domWrapper);
|
||||||
myCommitOnEveryChange = commitOnEveryChange;
|
myCommitOnEveryChange = commitOnEveryChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected EditorTextFieldControl(DomWrapper<String> domWrapper) {
|
||||||
protected EditorTextFieldControl(final DomWrapper<String> domWrapper) {
|
|
||||||
this(domWrapper, false);
|
this(domWrapper, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,28 +62,28 @@ public abstract class EditorTextFieldControl<T extends JComponent> extends BaseM
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doReset() {
|
protected void doReset() {
|
||||||
final EditorTextField textField = getEditorTextField(getComponent());
|
EditorTextField textField = getEditorTextField(getComponent());
|
||||||
textField.getDocument().removeDocumentListener(myListener);
|
textField.getDocument().removeDocumentListener(myListener);
|
||||||
super.doReset();
|
super.doReset();
|
||||||
textField.getDocument().addDocumentListener(myListener);
|
textField.getDocument().addDocumentListener(myListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected JComponent getComponentToListenFocusLost(final T component) {
|
protected JComponent getComponentToListenFocusLost(T component) {
|
||||||
return getEditorTextField(getComponent());
|
return getEditorTextField(getComponent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected JComponent getHighlightedComponent(final T component) {
|
protected JComponent getHighlightedComponent(T component) {
|
||||||
return J_TEXT_FIELD;
|
return J_TEXT_FIELD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected T createMainComponent(T boundedComponent) {
|
protected T createMainComponent(T boundedComponent) {
|
||||||
final Project project = getProject();
|
Project project = getProject();
|
||||||
boundedComponent = createMainComponent(boundedComponent, project);
|
boundedComponent = createMainComponent(boundedComponent, project);
|
||||||
|
|
||||||
final EditorTextField editorTextField = getEditorTextField(boundedComponent);
|
EditorTextField editorTextField = getEditorTextField(boundedComponent);
|
||||||
editorTextField.setSupplementary(true);
|
editorTextField.setSupplementary(true);
|
||||||
editorTextField.getDocument().addDocumentListener(myListener);
|
editorTextField.getDocument().addDocumentListener(myListener);
|
||||||
return boundedComponent;
|
return boundedComponent;
|
||||||
@@ -97,46 +97,46 @@ public abstract class EditorTextFieldControl<T extends JComponent> extends BaseM
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setValue(final String value) {
|
protected void setValue(String value) {
|
||||||
CommandProcessor.getInstance().runUndoTransparentAction(() -> WriteAction.run(() -> {
|
CommandProcessor.getInstance().runUndoTransparentAction(() -> WriteAction.run(() -> {
|
||||||
final T component = getComponent();
|
T component = getComponent();
|
||||||
final Document document = getEditorTextField(component).getDocument();
|
Document document = getEditorTextField(component).getDocument();
|
||||||
document.replaceString(0, document.getTextLength(), value == null ? "" : value);
|
document.replaceString(0, document.getTextLength(), value == null ? "" : value);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateComponent() {
|
protected void updateComponent() {
|
||||||
final DomElement domElement = getDomElement();
|
DomElement domElement = getDomElement();
|
||||||
if (domElement == null || !domElement.isValid()) return;
|
if (domElement == null || !domElement.isValid()) return;
|
||||||
|
|
||||||
final EditorTextField textField = getEditorTextField(getComponent());
|
EditorTextField textField = getEditorTextField(getComponent());
|
||||||
final Project project = getProject();
|
Project project = getProject();
|
||||||
ApplicationManager.getApplication().invokeLater(() -> {
|
ApplicationManager.getApplication().invokeLater(() -> {
|
||||||
if (!project.isOpen()) return;
|
if (!project.isOpen()) return;
|
||||||
if (!getDomWrapper().isValid()) return;
|
if (!getDomWrapper().isValid()) return;
|
||||||
|
|
||||||
final DomElement domElement1 = getDomElement();
|
DomElement domElement1 = getDomElement();
|
||||||
if (domElement1 == null || !domElement1.isValid()) return;
|
if (domElement1 == null || !domElement1.isValid()) return;
|
||||||
|
|
||||||
final DomElementAnnotationsManager manager = DomElementAnnotationsManager.getInstance(project);
|
DomElementAnnotationsManager manager = DomElementAnnotationsManager.getInstance(project);
|
||||||
final DomElementsProblemsHolder holder = manager.getCachedProblemHolder(domElement1);
|
DomElementsProblemsHolder holder = manager.getCachedProblemHolder(domElement1);
|
||||||
final List<DomElementProblemDescriptor> errorProblems = holder.getProblems(domElement1);
|
List<DomElementProblemDescriptor> errorProblems = holder.getProblems(domElement1);
|
||||||
final List<DomElementProblemDescriptor> warningProblems =
|
List<DomElementProblemDescriptor> warningProblems =
|
||||||
new ArrayList<>(holder.getProblems(domElement1, true, HighlightSeverity.WARNING));
|
new ArrayList<>(holder.getProblems(domElement1, true, HighlightSeverity.WARNING));
|
||||||
warningProblems.removeAll(errorProblems);
|
warningProblems.removeAll(errorProblems);
|
||||||
|
|
||||||
Color background = getDefaultBackground();
|
Color background = getDefaultBackground();
|
||||||
if (errorProblems.size() > 0 && textField.getText().trim().length() == 0) {
|
if (!errorProblems.isEmpty() && textField.getText().trim().isEmpty()) {
|
||||||
background = getErrorBackground();
|
background = getErrorBackground();
|
||||||
}
|
}
|
||||||
else if (warningProblems.size() > 0) {
|
else if (!warningProblems.isEmpty()) {
|
||||||
background = getWarningBackground();
|
background = getWarningBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
final Editor editor = textField.getEditor();
|
Editor editor = textField.getEditor();
|
||||||
if (editor != null) {
|
if (editor != null) {
|
||||||
final MarkupModel markupModel = editor.getMarkupModel();
|
MarkupModel markupModel = editor.getMarkupModel();
|
||||||
markupModel.removeAllHighlighters();
|
markupModel.removeAllHighlighters();
|
||||||
if (!errorProblems.isEmpty() && editor.getDocument().getLineCount() > 0) {
|
if (!errorProblems.isEmpty() && editor.getDocument().getLineCount() > 0) {
|
||||||
markupModel.addLineHighlighter(CodeInsightColors.ERRORS_ATTRIBUTES, 0, 0);
|
markupModel.addLineHighlighter(CodeInsightColors.ERRORS_ATTRIBUTES, 0, 0);
|
||||||
@@ -146,17 +146,16 @@ public abstract class EditorTextFieldControl<T extends JComponent> extends BaseM
|
|||||||
|
|
||||||
textField.setBackground(background);
|
textField.setBackground(background);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canNavigate(final DomElement element) {
|
public boolean canNavigate(DomElement element) {
|
||||||
return getDomElement().equals(element);
|
return getDomElement().equals(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void navigate(final DomElement element) {
|
public void navigate(DomElement element) {
|
||||||
final EditorTextField field = getEditorTextField(getComponent());
|
EditorTextField field = getEditorTextField(getComponent());
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(field, true));
|
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(field, true));
|
||||||
field.selectAll();
|
field.selectAll();
|
||||||
|
|||||||
@@ -225,10 +225,8 @@ public abstract class BaseControl<Bound extends JComponent, T> extends DomUICont
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void navigate(DomElement element) {
|
public void navigate(DomElement element) { }
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract @Nullable T getValue();
|
protected abstract @Nullable T getValue();
|
||||||
protected abstract void setValue(T value);
|
protected abstract void setValue(T value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user