mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
NPE; make title bold
This commit is contained in:
+5
-2
@@ -92,11 +92,14 @@ public class InplaceIntroduceFieldPopup extends AbstractJavaInplaceIntroducer {
|
||||
new IntroduceFieldPopupPanel(parentClass, initializerExpression, localVariable, currentMethodConstructor, localVariable != null, aStatic,
|
||||
myOccurrences, allowInitInMethod, allowInitInMethodIfAll, typeSelectorManager);
|
||||
|
||||
myWholePanel.add(myLabel, BorderLayout.NORTH);
|
||||
final GridBagConstraints constraints =
|
||||
new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
|
||||
new Insets(0, 0, 0, 0), 0, 0);
|
||||
myWholePanel.add(myLabel, constraints);
|
||||
|
||||
final JComponent centerPanel = myIntroduceFieldPanel.createCenterPanel();
|
||||
|
||||
myWholePanel.add(centerPanel, BorderLayout.WEST);
|
||||
myWholePanel.add(centerPanel, constraints);
|
||||
|
||||
myIntroduceFieldPanel.initializeControls(initializerExpression, ourLastInitializerPlace);
|
||||
}
|
||||
|
||||
+1
-2
@@ -227,8 +227,7 @@ public class InplaceIntroduceParameterPopup extends AbstractJavaInplaceIntroduce
|
||||
}
|
||||
myLabel.append(")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
}
|
||||
myWholePanel.revalidate();
|
||||
((BalloonImpl)myBalloon).revalidate(new PositionTracker.Static<Balloon>(myTarget));
|
||||
revalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -125,6 +125,9 @@ public class InplaceIntroduceFieldTest extends LightCodeInsightTestCase {
|
||||
state.gotoEnd(false);
|
||||
checkResultByFile(BASE_PATH + name + "_after.java");
|
||||
}
|
||||
catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
finally {
|
||||
myEditor.getSettings().setVariableInplaceRenameEnabled(enabled);
|
||||
templateManager.setTemplateTesting(false);
|
||||
|
||||
+11
-5
@@ -48,6 +48,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.refactoring.rename.inplace.VariableInplaceRenamer;
|
||||
import com.intellij.ui.BalloonImpl;
|
||||
import com.intellij.ui.SimpleColoredComponent;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
import com.intellij.util.ui.PositionTracker;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -190,16 +191,21 @@ public abstract class AbstractInplaceIntroducer<V extends PsiNameIdentifierOwner
|
||||
|
||||
protected void updateTitle(V variable, String value) {
|
||||
myLabel.clear();
|
||||
myLabel.append(variable.getText().replace(variable.getName(), value));
|
||||
myWholePanel.revalidate();
|
||||
((BalloonImpl)myBalloon).revalidate(new PositionTracker.Static<Balloon>(myTarget));
|
||||
myLabel.append(variable.getText().replace(variable.getName(), value), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
|
||||
revalidate();
|
||||
}
|
||||
|
||||
protected void updateTitle(V variable) {
|
||||
myLabel.clear();
|
||||
myLabel.append(variable.getText());
|
||||
myLabel.append(variable.getText(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
|
||||
revalidate();
|
||||
}
|
||||
|
||||
protected void revalidate() {
|
||||
myWholePanel.revalidate();
|
||||
((BalloonImpl)myBalloon).revalidate(new PositionTracker.Static<Balloon>(myTarget));
|
||||
if (myTarget != null) {
|
||||
((BalloonImpl)myBalloon).revalidate(new PositionTracker.Static<Balloon>(myTarget));
|
||||
}
|
||||
}
|
||||
|
||||
public void restartInplaceIntroduceTemplate() {
|
||||
|
||||
Reference in New Issue
Block a user