本文整理汇总了Java中com.intellij.ui.EditorTextField.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java EditorTextField.setEnabled方法的具体用法?Java EditorTextField.setEnabled怎么用?Java EditorTextField.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.EditorTextField
的用法示例。
在下文中一共展示了EditorTextField.setEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collapseIfPossible
import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
private static void collapseIfPossible(@NotNull EditorTextField editorTextField,
@NotNull ProjectSystemId systemId,
@NotNull Project project) {
Editor editor = editorTextField.getEditor();
if (editor != null) {
String rawText = editor.getDocument().getText();
if (StringUtil.isEmpty(rawText)) return;
if (EMPTY_PARENT.equals(rawText)) {
editorTextField.setEnabled(false);
return;
}
final Collection<ExternalProjectInfo> projectsData =
ProjectDataManager.getInstance().getExternalProjectsData(project, systemId);
for (ExternalProjectInfo projectInfo : projectsData) {
if (projectInfo.getExternalProjectStructure() != null && projectInfo.getExternalProjectPath().equals(rawText)) {
editorTextField.setEnabled(true);
ExternalProjectPathField.collapse(
editorTextField.getEditor(), projectInfo.getExternalProjectStructure().getData().getExternalName());
return;
}
}
}
}
示例2: buildView
import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
public void buildView(PackageTemplateWrapper ptWrapper, JPanel container) {
jlVariable = new JLabel(AllIcons.Nodes.Variable, JLabel.LEFT);
jlVariable.setDisabledIcon(jlVariable.getIcon());
jlVariable.setText("variable");
tfKey = new EditorTextField(globalVariable.getName());
tfKey.setAlignmentX(Component.LEFT_ALIGNMENT);
// UIHelper.setRightPadding(tfKey, PADDING_LABEL);
tfValue = UIHelper.getEditorTextField(globalVariable.getValue(), ptWrapper.getProject());
if (ptWrapper.getMode() == PackageTemplateWrapper.ViewMode.USAGE) {
tfKey.setEnabled(false);
} else {
jlVariable.addMouseListener(new ClickListener() {
@Override
public void mouseClicked(MouseEvent eventOuter) {
if (SwingUtilities.isRightMouseButton(eventOuter)) {
JPopupMenu popupMenu = getPopupMenu(ptWrapper);
popupMenu.show(jlVariable, eventOuter.getX(), eventOuter.getY());
}
}
});
}
// Lock modifying BASE_NAME
if (getGlobalVariable().getName().equals(ATTRIBUTE_BASE_NAME)) {
tfKey.setEnabled(false);
}
container.add(createOptionsBlock(), new CC().spanX().split(3));
container.add(tfKey, new CC().width("0").pushX().growX());
container.add(tfValue, new CC().width("0").pushX().growX().wrap());
}
示例3: validateTextFields
import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
private void validateTextFields(final int selectedIndex) {
for (EditorTextField textField : myOldClassParameterNameFields.values()) {
textField.setEnabled(true);
}
final PsiVariable variable = myVariables[selectedIndex];
if (variable instanceof PsiField) {
final PsiField field = (PsiField)variable;
final PsiClass hisClass = field.getContainingClass();
final Set<PsiMember> members = myThisClassesMap.get(hisClass);
if (members != null && members.size() == 1 && members.contains(field)) { //Just the field is referenced
myOldClassParameterNameFields.get(hisClass).setEnabled(false);
}
}
}