本文整理匯總了Java中com.intellij.ui.components.JBScrollPane.setViewportView方法的典型用法代碼示例。如果您正苦於以下問題:Java JBScrollPane.setViewportView方法的具體用法?Java JBScrollPane.setViewportView怎麽用?Java JBScrollPane.setViewportView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.ui.components.JBScrollPane
的用法示例。
在下文中一共展示了JBScrollPane.setViewportView方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: JPanel
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
myContentPanel = new JPanel();
myContentPanel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1));
myContentPanel.add(panel1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
myAcceptYoursButton = new JButton();
myAcceptYoursButton.setEnabled(false);
myAcceptYoursButton.setText("Accept Yours");
myAcceptYoursButton.setMnemonic('Y');
myAcceptYoursButton.setDisplayedMnemonicIndex(7);
panel1.add(myAcceptYoursButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
myAcceptTheirsButton = new JButton();
myAcceptTheirsButton.setEnabled(false);
myAcceptTheirsButton.setText("Accept Theirs");
myAcceptTheirsButton.setMnemonic('T');
myAcceptTheirsButton.setDisplayedMnemonicIndex(7);
panel1.add(myAcceptTheirsButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
myMergeButton = new JButton();
myMergeButton.setEnabled(false);
myMergeButton.setText("Merge");
myMergeButton.setMnemonic('M');
myMergeButton.setDisplayedMnemonicIndex(0);
panel1.add(myMergeButton, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JBScrollPane jBScrollPane1 = new JBScrollPane();
myContentPanel.add(jBScrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
myItemsTable = new JBTable();
myItemsTable.putClientProperty("Table.isFileList", Boolean.FALSE);
jBScrollPane1.setViewportView(myItemsTable);
}
示例2: JPanel
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));
final JBScrollPane jBScrollPane1 = new JBScrollPane();
contentPane.add(jBScrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
tree = new Tree();
jBScrollPane1.setViewportView(tree);
pathField = new JTextField();
pathField.setEditable(false);
contentPane.add(pathField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
messagePanel = new JPanel();
messagePanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(messagePanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
messagePanel.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(11, 10), null, 0, false));
messageLabel = new JLabel();
messageLabel.setText("Label");
messagePanel.add(messageLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
示例3: createUIComponents
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
private void createUIComponents() {
// TODO: place custom component creation code here
rootPanel = new JPanel();
sqlPanel = new JPanel();
sqlPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
// 設置 sql text editor
Document document = EditorFactory.getInstance().createDocument("");
sqlTextArea = EditorFactory.getInstance().createEditor(document, ideaContext.getProject(), SqlFileType.INSTANCE, false);
sqlScrollPane = new JBScrollPane();
sqlScrollPane.setViewportView(sqlTextArea.getComponent());
}
示例4: createUIComponents
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
private void createUIComponents() {
contexts = new JBTable(new ModuleTableModel());
contexts.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
contexts.setDefaultRenderer(String.class, new ModuleCellRenderer());
contexts.getColumnModel().getColumn(0).setPreferredWidth(25);
tableScrollPane = new JBScrollPane();
tableScrollPane.setViewportView(contexts);
tableScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
tableScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
tableScrollPane.setPreferredSize(new Dimension(400, 100));
tableScrollPane.setSize(new Dimension(400, 100));
}
示例5: createCourseSpecificTab
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
public void createCourseSpecificTab(
ObjectFinder finder,
ProjectOpener opener,
String course,
JTabbedPane tabbedPaneBase,
CourseAndExerciseManager courseAndExerciseManager) {
logger.info("Creating course specific tab. @CourseTabFactory");
final JBScrollPane panel = new JBScrollPane();
final JBList list = new JBList();
list.setCellRenderer(new ProjectListRenderer());
DefaultListModel defaultListModel = new DefaultListModel();
panel.setBorder(BorderFactory.createTitledBorder(""));
ProjectListManagerHolder.get()
.addExercisesToList(finder, course, defaultListModel, courseAndExerciseManager);
if (defaultListModel.getSize() <= 0) {
return;
}
list.setName(course);
list.setModel(defaultListModel);
MouseListener mouseListener = createMouseListenerForWindow(opener, panel, list);
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.addMouseListener(mouseListener);
panel.setName(course);
panel.setViewportView(list);
ProjectListManagerHolder.get().addList(list);
tabbedPaneBase.addTab(course, panel);
tabbedPaneBase.addMouseListener(tabMouseListener(tabbedPaneBase));
setScrollBarToBottom(course, tabbedPaneBase, panel);
}
示例6: ArrangementRuleAliasesPanel
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
public ArrangementRuleAliasesPanel(@NotNull ArrangementStandardSettingsManager settingsManager,
@NotNull ArrangementColorsProvider colorsProvider) {
super(new GridBagLayout());
setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
JBScrollPane scrollPane = new JBScrollPane();
final JViewport viewport = scrollPane.getViewport();
ArrangementMatchingRulesControl.RepresentationCallback callback = new ArrangementMatchingRulesControl.RepresentationCallback() {
@Override
public void ensureVisible(@NotNull Rectangle r) {
Rectangle visibleRect = viewport.getViewRect();
if (r.y <= visibleRect.y) {
return;
}
int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
if (excessiveHeight <= 0) {
return;
}
int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
if (verticalShift > 0) {
viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
}
}
};
myControl = new ArrangementRuleAliasControl(settingsManager, colorsProvider, callback);
scrollPane.setViewportView(myControl);
CustomizationUtil.installPopupHandler(
myControl, ArrangementConstants.ALIAS_RULE_CONTEXT_MENU, ArrangementConstants.ALIAS_RULE_CONTROL_PLACE
);
TitleWithToolbar top = new TitleWithToolbar(
ApplicationBundle.message("arrangement.settings.section.rule.sequence"),
ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR,
ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR_PLACE,
myControl
);
add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
示例7: AtomController
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
public AtomController(@NotNull Project project, @NotNull JBScrollPane scrollPane) {
scrollPane.getHorizontalScrollBar().setUnitIncrement(20);
scrollPane.getVerticalScrollBar().setUnitIncrement(20);
myTree = new SimpleTree();
myTree.setRowHeight(TreeUtil.TREE_ROW_HEIGHT);
myTree.setRootVisible(false);
myTree.setLineStyleAngled();
myTree.getEmptyText().setText(SELECT_CAPTURE);
myLoadingPanel = new JBLoadingPanel(new BorderLayout(), project);
myLoadingPanel.add(myTree);
scrollPane.setViewportView(myLoadingPanel);
myAtomTreeRenderer = new AtomTreeRenderer();
}
示例8: StateController
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
public StateController(@NotNull GfxTraceEditor editor, @NotNull JBScrollPane scrollPane) {
myEditor = editor;
myTree = new SimpleTree();
myTree.setRowHeight(TreeUtil.TREE_ROW_HEIGHT);
myTree.setRootVisible(false);
myTree.setCellRenderer(new StateTreeRenderer());
myTree.getEmptyText().setText(SELECT_CAPTURE);
myLoadingPanel = new JBLoadingPanel(new BorderLayout(), editor.getProject());
myLoadingPanel.add(myTree);
scrollPane.setViewportView(myLoadingPanel);
}
示例9: JPanel
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new BorderLayout(0, 0));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, BorderLayout.SOUTH);
panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.LockBox")));
lockCheckInRadioButton = new JRadioButton();
this.$$$loadButtonText$$$(lockCheckInRadioButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.CheckinRadio"));
panel1.add(lockCheckInRadioButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
lockCheckOutRadioButton = new JRadioButton();
this.$$$loadButtonText$$$(lockCheckOutRadioButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.CheckoutRadio"));
panel1.add(lockCheckOutRadioButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
recursiveCheckBox = new JCheckBox();
recursiveCheckBox.setSelected(true);
this.$$$loadButtonText$$$(recursiveCheckBox, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.RecursiveCheck"));
panel1.add(recursiveCheckBox, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new BorderLayout(0, 0));
contentPane.add(panel2, BorderLayout.CENTER);
panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.ItemsBox")));
final JBScrollPane jBScrollPane1 = new JBScrollPane();
panel2.add(jBScrollPane1, BorderLayout.CENTER);
lockItemsTable = new JBTable();
lockItemsTable.setEnabled(true);
lockItemsTable.setPreferredScrollableViewportSize(new Dimension(500, 200));
jBScrollPane1.setViewportView(lockItemsTable);
ButtonGroup buttonGroup;
buttonGroup = new ButtonGroup();
buttonGroup.add(lockCheckInRadioButton);
buttonGroup.add(lockCheckOutRadioButton);
}
示例10: createUIComponents
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
createUIComponents();
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1));
final JBScrollPane jBScrollPane1 = new JBScrollPane();
contentPane.add(jBScrollPane1, new GridConstraints(0, 0, 3, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
jBScrollPane1.setViewportView(treeTable);
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Accounts.Panel.Title")));
reloadWorkspacesButton = new JButton();
this.$$$loadButtonText$$$(reloadWorkspacesButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Reload.Button"));
panel1.add(reloadWorkspacesButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
proxySettingsButton = new JButton();
this.$$$loadButtonText$$$(proxySettingsButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Proxy.Button"));
panel1.add(proxySettingsButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
workspacesPanel = new JPanel();
workspacesPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(workspacesPanel, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
workspacesPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Workspaces.Panel.Title")));
editWorkspaceButton = new JButton();
this.$$$loadButtonText$$$(editWorkspaceButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Edit.Button"));
workspacesPanel.add(editWorkspaceButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
deleteWorkspaceButton = new JButton();
this.$$$loadButtonText$$$(deleteWorkspaceButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Delete.Button"));
workspacesPanel.add(deleteWorkspaceButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
contentPane.add(spacer1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
}
示例11: ArrangementRuleAliasesPanel
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
public ArrangementRuleAliasesPanel(@Nonnull ArrangementStandardSettingsManager settingsManager,
@Nonnull ArrangementColorsProvider colorsProvider) {
super(new GridBagLayout());
setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
JBScrollPane scrollPane = new JBScrollPane();
final JViewport viewport = scrollPane.getViewport();
ArrangementMatchingRulesControl.RepresentationCallback callback = new ArrangementMatchingRulesControl.RepresentationCallback() {
@Override
public void ensureVisible(@Nonnull Rectangle r) {
Rectangle visibleRect = viewport.getViewRect();
if (r.y <= visibleRect.y) {
return;
}
int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
if (excessiveHeight <= 0) {
return;
}
int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
if (verticalShift > 0) {
viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
}
}
};
myControl = new ArrangementRuleAliasControl(settingsManager, colorsProvider, callback);
scrollPane.setViewportView(myControl);
CustomizationUtil.installPopupHandler(
myControl, ArrangementConstants.ALIAS_RULE_CONTEXT_MENU, ArrangementConstants.ALIAS_RULE_CONTROL_PLACE
);
TitleWithToolbar top = new TitleWithToolbar(
ApplicationBundle.message("arrangement.settings.section.rule.sequence"),
ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR,
ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR_PLACE,
myControl
);
add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
示例12: initComponents
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
/**
* This method is called from within the constructor to initialize the form. WARNING: Do NOT
* modify this code. The content of this method is always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
private void initComponents() {
logger.info("Initializing components for TextQuestionPanel " + "@TextQuestionPanel");
questionLabel = new javax.swing.JLabel();
//textAreaScrollPane = new javax.swing.JScrollPane();
textAreaScrollPane = new JBScrollPane();
answerTextArea = new javax.swing.JTextArea();
//questionLabel.setText(org.openide.util.NbBundle.getMessage(TextQuestionPanel.class, "TextQuestionPanel.questionLabel.text")); // NOI18N
questionLabel.setText("Teting testing TextQuestionPanle"); // NOI18N
answerTextArea.setColumns(20);
answerTextArea.setLineWrap(true);
answerTextArea.setRows(5);
answerTextArea.setWrapStyleWord(true);
textAreaScrollPane.setViewportView(answerTextArea);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addContainerGap()
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment
.LEADING)
.addComponent(
textAreaScrollPane,
javax.swing.GroupLayout
.DEFAULT_SIZE,
362,
Short.MAX_VALUE)
.addComponent(questionLabel))
.addContainerGap()));
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addContainerGap()
.addComponent(questionLabel)
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(
textAreaScrollPane,
javax.swing.GroupLayout.DEFAULT_SIZE,
82,
Short.MAX_VALUE)
.addContainerGap()));
}
示例13: DetailsPanel
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
DetailsPanel(@NotNull VcsLogDataHolder logDataHolder,
@NotNull VcsLogGraphTable graphTable,
@NotNull VcsLogColorManager colorManager,
@NotNull VisiblePack initialDataPack) {
myLogDataHolder = logDataHolder;
myGraphTable = graphTable;
myColorManager = colorManager;
myDataPack = initialDataPack;
myReferencesPanel = new ReferencesPanel(myColorManager);
myCommitDetailsPanel = new DataPanel(logDataHolder.getProject(), logDataHolder.isMultiRoot(), logDataHolder);
myScrollPane = new JBScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
myMainContentPanel = new JPanel(new MigLayout("flowy, ins 0, hidemode 3, gapy 0")) {
@Override
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
size.width = myScrollPane.getViewport().getWidth() - 5;
return size;
}
};
myMainContentPanel.setOpaque(false);
myScrollPane.setOpaque(false);
myScrollPane.getViewport().setOpaque(false);
myScrollPane.setViewportView(myMainContentPanel);
myMainContentPanel.add(myReferencesPanel, "");
myMainContentPanel.add(myCommitDetailsPanel, "");
myLoadingPanel = new JBLoadingPanel(new BorderLayout(), logDataHolder, ProgressWindow.DEFAULT_PROGRESS_DIALOG_POSTPONE_TIME_MILLIS) {
@Override
public Color getBackground() {
return getDetailsBackground();
}
};
myLoadingPanel.add(myScrollPane);
myMessagePanel = new MessagePanel();
setLayout(new CardLayout());
add(myLoadingPanel, STANDARD_LAYER);
add(myMessagePanel, MESSAGE_LAYER);
showMessage("No commits selected");
}
示例14: ArrangementMatchingRulesPanel
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
public ArrangementMatchingRulesPanel(@NotNull Language language,
@NotNull ArrangementStandardSettingsManager settingsManager,
@NotNull ArrangementColorsProvider colorsProvider)
{
super(new GridBagLayout());
JBScrollPane scrollPane = new JBScrollPane();
final JViewport viewport = scrollPane.getViewport();
ArrangementSectionRulesControl.RepresentationCallback callback = new ArrangementSectionRulesControl.RepresentationCallback() {
@Override
public void ensureVisible(@NotNull Rectangle r) {
Rectangle visibleRect = viewport.getViewRect();
if (r.y <= visibleRect.y) {
return;
}
int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
if (excessiveHeight <= 0) {
return;
}
int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
if (verticalShift > 0) {
viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
}
}
};
myControl = createRulesControl(language, settingsManager, colorsProvider, callback);
scrollPane.setViewportView(myControl);
CustomizationUtil.installPopupHandler(
myControl, ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTEXT_MENU, ArrangementConstants.MATCHING_RULES_CONTROL_PLACE
);
TitleWithToolbar top = new TitleWithToolbar(
ApplicationBundle.message("arrangement.settings.section.match"),
ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTROL_TOOLBAR,
ArrangementConstants.MATCHING_RULES_CONTROL_TOOLBAR_PLACE,
myControl
);
add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
示例15: JPanel
import com.intellij.ui.components.JBScrollPane; //導入方法依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(8, 1, new Insets(0, 0, 0, 0), -1, -1));
final JLabel label1 = new JLabel();
this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.NameLabel"));
contentPane.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
nameText = new JTextField();
contentPane.add(nameText, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label2 = new JLabel();
this.$$$loadLabelText$$$(label2, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.CommentLabel"));
contentPane.add(label2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label3 = new JLabel();
this.$$$loadLabelText$$$(label3, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.ItemsLabel"));
contentPane.add(label3, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
addButton = new JButton();
this.$$$loadButtonText$$$(addButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.AddButton"));
panel1.add(addButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
removeButton = new JButton();
removeButton.setEnabled(false);
this.$$$loadButtonText$$$(removeButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.RemoveButton"));
panel1.add(removeButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JBScrollPane jBScrollPane1 = new JBScrollPane();
contentPane.add(jBScrollPane1, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(-1, 250), null, 0, false));
itemsTable = new JBTable();
jBScrollPane1.setViewportView(itemsTable);
final JBScrollPane jBScrollPane2 = new JBScrollPane();
contentPane.add(jBScrollPane2, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
commentTextArea = new JTextArea();
commentTextArea.setRows(4);
jBScrollPane2.setViewportView(commentTextArea);
recursiveCheckBox = new JCheckBox();
recursiveCheckBox.setSelected(true);
this.$$$loadButtonText$$$(recursiveCheckBox, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.RecursiveCheckBox"));
contentPane.add(recursiveCheckBox, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
label1.setLabelFor(nameText);
}