当前位置: 首页>>代码示例>>Java>>正文


Java EditorTextField.isEnabled方法代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:MoveInstanceMethodDialog.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:MoveInstanceMethodDialog.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:25,代码来源:MoveInstanceMethodDialog.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:DarculaEditorTextFieldBorder.java

示例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);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:DarculaEditorTextFieldBorder.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:31,代码来源:DarculaEditorTextFieldBorder.java


注:本文中的com.intellij.ui.EditorTextField.isEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。