本文整理汇总了Java中com.intellij.ui.EditorTextField.isEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java EditorTextField.isEnabled方法的具体用法?Java EditorTextField.isEnabled怎么用?Java EditorTextField.isEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.EditorTextField
的用法示例。
在下文中一共展示了EditorTextField.isEnabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doAction
import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
protected void doAction() {
Map<PsiClass, String> parameterNames = new LinkedHashMap<PsiClass, String>();
for (final PsiClass aClass : myThisClassesMap.keySet()) {
EditorTextField field = myOldClassParameterNameFields.get(aClass);
if (field.isEnabled()) {
String parameterName = field.getText().trim();
if (!PsiNameHelper.getInstance(myMethod.getProject()).isIdentifier(parameterName)) {
Messages
.showErrorDialog(getProject(), RefactoringBundle.message("move.method.enter.a.valid.name.for.parameter"), myRefactoringName);
return;
}
parameterNames.put(aClass, parameterName);
}
}
final PsiVariable targetVariable = (PsiVariable)myList.getSelectedValue();
if (targetVariable == null) return;
final MoveInstanceMethodProcessor processor = new MoveInstanceMethodProcessor(myMethod.getProject(),
myMethod, targetVariable,
myVisibilityPanel.getVisibility(),
isOpenInEditor(),
parameterNames);
if (!verifyTargetClass(processor.getTargetClass())) return;
saveOpenInEditorOption();
invokeRefactoring(processor);
}
示例2: doAction
import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
protected void doAction() {
Map<PsiClass, String> parameterNames = new LinkedHashMap<PsiClass, String>();
for (final PsiClass aClass : myThisClassesMap.keySet()) {
EditorTextField field = myOldClassParameterNameFields.get(aClass);
if (field.isEnabled()) {
String parameterName = field.getText().trim();
if (!JavaPsiFacade.getInstance(myMethod.getProject()).getNameHelper().isIdentifier(parameterName)) {
Messages
.showErrorDialog(getProject(), RefactoringBundle.message("move.method.enter.a.valid.name.for.parameter"), myRefactoringName);
return;
}
parameterNames.put(aClass, parameterName);
}
}
final PsiVariable targetVariable = (PsiVariable)myList.getSelectedValue();
if (targetVariable == null) return;
final MoveInstanceMethodProcessor processor = new MoveInstanceMethodProcessor(myMethod.getProject(),
myMethod, targetVariable,
myVisibilityPanel.getVisibility(),
parameterNames);
if (!verifyTargetClass(processor.getTargetClass())) return;
invokeRefactoring(processor);
}
示例3: doAction
import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
protected void doAction() {
Map<PsiClass, String> parameterNames = new LinkedHashMap<PsiClass, String>();
for (final PsiClass aClass : myThisClassesMap.keySet()) {
EditorTextField field = myOldClassParameterNameFields.get(aClass);
if (field.isEnabled()) {
String parameterName = field.getText().trim();
if (!PsiNameHelper.getInstance(myMethod.getProject()).isIdentifier(parameterName)) {
Messages
.showErrorDialog(getProject(), RefactoringBundle.message("move.method.enter.a.valid.name.for.parameter"), myRefactoringName);
return;
}
parameterNames.put(aClass, parameterName);
}
}
final PsiVariable targetVariable = (PsiVariable)myList.getSelectedValue();
if (targetVariable == null) return;
final MoveInstanceMethodProcessor processor = new MoveInstanceMethodProcessor(myMethod.getProject(),
myMethod, targetVariable,
myVisibilityPanel.getVisibility(),
parameterNames);
if (!verifyTargetClass(processor.getTargetClass())) return;
invokeRefactoring(processor);
}
示例4: paintBorder
import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
if (isComboBoxEditor(c) /*|| isCellEditor(c)*/) {
g.setColor(c.getBackground());
g.fillRect(x, y, width, height);
return;
}
final EditorTextField textField = UIUtil.getParentOfType(EditorTextField.class, c);
if (textField == null) return;
final Rectangle r = new Rectangle(x + 1, y + 1, width - 2, height - 2);
if (c.isOpaque()) {
g.setColor(UIUtil.getPanelBackground());
g.fillRect(x, y, width, height);
}
g.setColor(c.getBackground());
g.fillRect(r.x, r.y, r.width, r.height);
if (!textField.isEnabled()) {
((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.4f));
}
if (textField.isEnabled() && textField.isVisible() && textField.getFocusTarget().hasFocus()) {
DarculaUIUtil.paintFocusRing(g, r.x + 1, r.y + 1, r.width - 2, r.height - 2);
} else {
g.setColor(new JBColor(Gray._150, Gray._100));
g.drawRect(r.x, r.y, r.width, r.height);
}
}
示例5: paintBorder
import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
final EditorTextField textField = UIUtil.getParentOfType(EditorTextField.class, c);
if (textField == null) return;
final int x1 = x + 3;
final int y1 = y + 3;
final int width1 = width - 8;
final int height1 = height - 6;
if (c.isOpaque()) {
g.setColor(UIUtil.getPanelBackground());
g.fillRect(x, y, width, height);
}
g.setColor(c.getBackground());
g.fillRect(x1, y1, width1, height1);
if (!textField.isEnabled()) {
((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.4f));
}
if (textField.isEnabled() && textField.isVisible() && textField.getFocusTarget().hasFocus()) {
DarculaUIUtil.paintFocusRing((Graphics2D)g, x1, y1, width1, height1);
} else {
g.setColor(Gray._100);
g.drawRect(x1, y1, width1, height1);
}
}
示例6: paintBorder
import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
final EditorTextField textField = UIUtil.getParentOfType(EditorTextField.class, c);
if (textField == null) return;
final int x1 = x + JBUI.scale(3);
final int y1 = y + JBUI.scale(3);
final int width1 = width - JBUI.scale(8);
final int height1 = height - JBUI.scale(6);
if (c.isOpaque()) {
g.setColor(UIUtil.getPanelBackground());
g.fillRect(x, y, width, height);
}
g.setColor(c.getBackground());
g.fillRect(x1, y1, width1, height1);
if (!textField.isEnabled()) {
((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.4f));
}
if (textField.isEnabled() && textField.isVisible() && textField.getFocusTarget().hasFocus()) {
DarculaUIUtil.paintFocusRing(g, new Rectangle(x1, y1, width1, height1));
}
else {
g.setColor(new JBColor(Gray._150, Gray._100));
g.drawRect(x1, y1, width1, height1);
}
}