當前位置: 首頁>>代碼示例>>Java>>正文


Java TextFieldWithBrowseButton.MyDoClickAction方法代碼示例

本文整理匯總了Java中com.intellij.openapi.ui.TextFieldWithBrowseButton.MyDoClickAction方法的典型用法代碼示例。如果您正苦於以下問題:Java TextFieldWithBrowseButton.MyDoClickAction方法的具體用法?Java TextFieldWithBrowseButton.MyDoClickAction怎麽用?Java TextFieldWithBrowseButton.MyDoClickAction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.ui.TextFieldWithBrowseButton的用法示例。


在下文中一共展示了TextFieldWithBrowseButton.MyDoClickAction方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createComponent

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
public void createComponent() {
  super.createComponent();
  TextFieldWithBrowseButton.MyDoClickAction doClickAction = getDoClickAction();
  if (doClickAction != null) {
    doClickAction.registerShortcut(myComboBox);
  }

  myComboBox.setMaximumRowCount(8);

  myComboBox.setEditable(true);
  final JTextField editorComponent = (JTextField)myComboBox.getEditor().getEditorComponent();
  editorComponent.getDocument().addDocumentListener(new DocumentAdapter() {
    protected void textChanged(DocumentEvent e) {
      final String text = getText();
      if (!Comparing.equal(text, oldText, true)) {
        oldText = text;
        final Runnable changeListener = getChangeListener();
        if (changeListener != null) {
          changeListener.run();
        }
      }
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:ComboBoxFieldPanel.java

示例2: createComponent

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
public void createComponent() {
  removeAll();
  setLayout(new GridBagLayout());

  if (myLabelText != null) {
    myLabel = new JLabel(myLabelText);
    this.add(myLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 0), 0, 0));
    myLabel.setLabelFor(myComponent);
  }

  this.add(myComponent, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));

  if (myBrowseButtonActionListener != null) {
    FixedSizeButton browseButton = new FixedSizeButton(getComponent());
    myDoClickAction = new TextFieldWithBrowseButton.MyDoClickAction(browseButton);
    browseButton.setFocusable(false);
    browseButton.addActionListener(myBrowseButtonActionListener);
    myButtons.add(browseButton);
    this.add(browseButton, new GridBagConstraints(GridBagConstraints.RELATIVE, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 2, 0, 0), 0, 0));
  }
  if (myViewerDialogTitle != null) {
    final FixedSizeButton showViewerButton = new FixedSizeButton(getComponent());
    if (myBrowseButtonActionListener == null) {
      LOG.assertTrue(myDoClickAction == null);
      myDoClickAction = new TextFieldWithBrowseButton.MyDoClickAction(showViewerButton);
    }
    showViewerButton.setFocusable(false);
    showViewerButton.setIcon(PlatformIcons.OPEN_EDIT_DIALOG_ICON);
    showViewerButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Viewer viewer = new Viewer();
        viewer.setTitle(myViewerDialogTitle);
        viewer.show();
      }
    });
    myButtons.add(showViewerButton);
    this.add(showViewerButton, new GridBagConstraints(GridBagConstraints.RELATIVE, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:40,代碼來源:AbstractFieldPanel.java

示例3: createComponent

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
public void createComponent() {
  super.createComponent();
  TextFieldWithBrowseButton.MyDoClickAction doClickAction = getDoClickAction();
  if (doClickAction != null) {
    doClickAction.registerShortcut(getTextField());
  }

  myTextField.getDocument().addDocumentListener(new DocumentAdapter() {
    public void textChanged(DocumentEvent event) {
      if (getChangeListener() != null) {
        getChangeListener().run();
      }
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:FieldPanel.java

示例4: getDoClickAction

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
protected TextFieldWithBrowseButton.MyDoClickAction getDoClickAction() { return myDoClickAction; } 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:2,代碼來源:AbstractFieldPanel.java


注:本文中的com.intellij.openapi.ui.TextFieldWithBrowseButton.MyDoClickAction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。