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


Java EditorTextField.setBorder方法代码示例

本文整理汇总了Java中com.intellij.ui.EditorTextField.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java EditorTextField.setBorder方法的具体用法?Java EditorTextField.setBorder怎么用?Java EditorTextField.setBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.EditorTextField的用法示例。


在下文中一共展示了EditorTextField.setBorder方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupPathComponent

import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
private void setupPathComponent(final JPanel northPanel) {
  northPanel.add(new TextFieldAction() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      toggleShowPathComponent(northPanel, this);
    }
  }, BorderLayout.EAST);
  myPathEditor = new EditorTextField(JavaReferenceEditorUtil.createDocument("", myProject, false), myProject, StdFileTypes.JAVA);
  myPathEditor.addDocumentListener(new DocumentAdapter() {
    @Override
    public void documentChanged(DocumentEvent e) {
      myAlarm.cancelAllRequests();
      myAlarm.addRequest(new Runnable() {
        @Override
        public void run() {
          updateTreeFromPath();
        }
      }, 300);
    }
  });
  myPathEditor.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0));
  northPanel.add(myPathEditor, BorderLayout.SOUTH);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:PackageChooserDialog.java

示例2: getTableCellEditorComponent

import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
public Component getTableCellEditorComponent(final JTable table,
                                             Object value,
                                             boolean isSelected,
                                             final int row,
                                             int column) {
  final EditorTextField textField = (EditorTextField)super.getTableCellEditorComponent(table, value, isSelected, row, column);
  textField.registerKeyboardAction(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      PsiType type = getRowType(table, row);
      if (type != null) {
        completeVariable(textField, type);
      }
    }
  }, KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW);
  textField.setBorder(new LineBorder(table.getSelectionBackground()));
  return textField;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JavaParameterTableModel.java

示例3: MyEditor

import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
public MyEditor(final Project project) {
  myProject = project;
  myEditorTextField = new EditorTextField("", project, StdFileTypes.JAVA) {
    protected boolean shouldHaveBorder() {
      return false;
    }
  };
  myActionListener = new MyActionListener();
  myTfWithButton = new ComponentWithBrowseButton<EditorTextField>(myEditorTextField, myActionListener);
  myEditorTextField.setBorder(null);
  new MyCancelEditingAction().registerCustomShortcutSet(CommonShortcuts.ESCAPE, myTfWithButton);
  /*
  myEditorTextField.addActionListener(
    new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        fireValueCommitted();
      }
    }
  );
  */
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ClassToBindProperty.java

示例4: getTableCellEditorComponent

import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
@Override
public Component getTableCellEditorComponent(final JTable table, Object value, boolean isSelected, final int row, int column)
{
	final EditorTextField textField = (EditorTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
	/*textField.registerKeyboardAction(new ActionListener()
	{
		@Override
		public void actionPerformed(ActionEvent e)
		{
			PsiType type = getRowType(table, row);
			if(type != null)
			{
				completeVariable(textField, type);
			}
		}
	}, KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW);*/
	textField.setBorder(new LineBorder(table.getSelectionBackground()));
	return textField;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:20,代码来源:CSharpParameterTableModel.java

示例5: MyEditor

import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
public MyEditor(final Project project) {
  myProject = project;
  myEditorTextField = new EditorTextField("", project, JavaFileType.INSTANCE) {
    protected boolean shouldHaveBorder() {
      return false;
    }
  };
  myActionListener = new MyActionListener();
  myTfWithButton = new ComponentWithBrowseButton<EditorTextField>(myEditorTextField, myActionListener);
  myEditorTextField.setBorder(null);
  new MyCancelEditingAction().registerCustomShortcutSet(CommonShortcuts.ESCAPE, myTfWithButton);
  /*
  myEditorTextField.addActionListener(
    new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        fireValueCommitted();
      }
    }
  );
  */
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:22,代码来源:ClassToBindProperty.java

示例6: createTextField

import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
@NotNull
private static EditorTextField createTextField(@NotNull Project project) {
  final EditorTextFieldProvider service = ServiceManager.getService(project, EditorTextFieldProvider.class);
  List<EditorCustomization> features = ContainerUtil.packNullables(SoftWrapsEditorCustomization.ENABLED,
                                                                   SpellCheckingEditorCustomizationProvider.getInstance().getDisabledCustomization());
  EditorTextField textField = service.getEditorField(FileTypes.PLAIN_TEXT.getLanguage(), project, features);
  textField.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2), textField.getBorder()));
  textField.setOneLineMode(false);
  return textField;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:MultilinePopupBuilder.java

示例7: createEditorField

import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
protected EditorTextField createEditorField(Document document) {
  EditorTextField field = new EditorTextField(document, myProject, myFileType) {
    @Override
    protected boolean shouldHaveBorder() {
      return false;
    }
  };
  field.setBorder(new EmptyBorder(1, 1, 1, 1));
  return field;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CodeFragmentTableCellEditorBase.java

示例8: createEditorField

import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
protected EditorTextField createEditorField(Document document) {
  EditorTextField field = new EditorTextField(document, myProject, myFileType) {
    protected boolean shouldHaveBorder() {
      return false;
    }
  };
  field.setBorder(new EmptyBorder(1, 1, 1, 1));
  return field;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:PyParameterTableModel.java

示例9: createUIComponents

import com.intellij.ui.EditorTextField; //导入方法依赖的package包/类
private void createUIComponents() {
  myProject = myRegexpFile.getProject();
  Document document = PsiDocumentManager.getInstance(myProject).getDocument(myRegexpFile);

  myRegExp = new EditorTextField(document, myProject, RegExpLanguage.INSTANCE.getAssociatedFileType());
  myRegExp.setPreferredWidth(Math.max(300, myRegExp.getPreferredSize().width));
  final String sampleText = PropertiesComponent.getInstance(myProject).getValue(LAST_EDITED_REGEXP, "Sample Text");
  mySampleText = new EditorTextField(sampleText, myProject, PlainTextFileType.INSTANCE);
  mySampleText.setBorder(
    new CompoundBorder(new EmptyBorder(2, 2, 2, 4), new LineBorder(UIUtil.isUnderDarcula() ? Gray._100 : JBColor.border())));
  mySampleText.setOneLineMode(false);

  myRootPanel = new JPanel(new BorderLayout()) {
    Disposable disposable;

    @Override
    public void addNotify() {
      super.addNotify();
      disposable = Disposer.newDisposable();

      IdeFocusManager.getGlobalInstance().requestFocus(mySampleText, true);

      new AnAction(){
        @Override
        public void actionPerformed(AnActionEvent e) {
          IdeFocusManager.findInstance().requestFocus(myRegExp.getFocusTarget(), true);
        }
      }.registerCustomShortcutSet(CustomShortcutSet.fromString("shift TAB"), mySampleText);

      final Alarm updater = new Alarm(Alarm.ThreadToUse.SWING_THREAD, disposable);
      DocumentAdapter documentListener = new DocumentAdapter() {
        @Override
        public void documentChanged(DocumentEvent e) {
          updater.cancelAllRequests();
          if (!updater.isDisposed()) {
            updater.addRequest(new Runnable() {
              @Override
              public void run() {
                updateBalloon();
              }
            }, 200);
          }
        }
      };
      myRegExp.addDocumentListener(documentListener);
      mySampleText.addDocumentListener(documentListener);

      updateBalloon();
      mySampleText.selectAll();
    }

    @Override
    public void removeNotify() {
      super.removeNotify();
      Disposer.dispose(disposable);
      PropertiesComponent.getInstance(myProject).setValue(LAST_EDITED_REGEXP, mySampleText.getText());
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:60,代码来源:CheckRegExpForm.java


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