List of usage examples for javax.swing JPanel putClientProperty
public final void putClientProperty(Object key, Object value)
From source file:com.aw.swing.mvp.JDialogView.java
private void initializeLayout() { if (!(vsr instanceof JDialog)) { UserInfo ui = pst.getApplicationUser(); String userName = ui.getUsername(); viewLayout = new MainFormLayout(getTitle(), "system1".equals(userName) ? " " : userName); JPanel formPanel = (JPanel) AttributeAccessor.get(vsr, "pnlMain"); formPanel.putClientProperty("pnlMain", true); /*/*from ww w .ja va 2 s . c o m*/ JPanel footerPanel = (JPanel) AttributeAccessor.get(vsr, "footerPanel"); Component[] components=footerPanel.getComponents(); for(int i=0;i<components.length;i++){ if(components[i] instanceof JLabel){ ((JLabel)components[i]).setBackground(new Color(-13395480)); ((JLabel)components[i]).setOpaque(true); ((JLabel)components[i]).setForeground(new Color(-1)); } } */ viewLayout.contentPanel.add(formPanel, BorderLayout.CENTER); AbstractAction aa = new AbstractAction() { public void actionPerformed(ActionEvent e) { if (logger.isDebugEnabled()) logger.debug("Closing view for " + pst); pst.closeView(); } }; if (pst instanceof FindPresenter || pst.isShowCloseButton()) { logger.info("Close button added to view"); // ((HeaderPanel) viewLayout.headerPanel).createCloseButton(aa); } addUserInfo(); } }
From source file:com.aw.swing.mvp.binding.BindingManager.java
public ParentComponentInfo setBindingPath(JPanel jpanel, String... paths) { ParentComponentInfo parentComponentInfo = new ParentComponentInfo(paths); jpanel.putClientProperty(BindingBuilder.BINDING_PATHS, parentComponentInfo); return parentComponentInfo; }
From source file:fsart.diffTools.gui.DiffToolsMainPanel.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it by your code! * * @noinspection ALL// ww w . j a va2 s .c o m */ private void $$$setupUI$$$() { panel1 = new JPanel(); panel1.setLayout(new BorderLayout(0, 0)); final Spacer spacer1 = new Spacer(); panel1.add(spacer1, BorderLayout.WEST); final Spacer spacer2 = new Spacer(); panel1.add(spacer2, BorderLayout.EAST); final Spacer spacer3 = new Spacer(); panel1.add(spacer3, BorderLayout.SOUTH); final Spacer spacer4 = new Spacer(); panel1.add(spacer4, BorderLayout.NORTH); final JPanel panel2 = new JPanel(); panel2.setLayout(new FormLayout( "left:max(d;4px):noGrow,left:4dlu:noGrow,center:max(d;50px):grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:5dlu:noGrow,fill:max(d;4px):noGrow", "top:d:grow,top:4dlu:noGrow,top:d:noGrow,top:4dlu:noGrow,center:max(d;25px):noGrow,top:6dlu:noGrow,top:max(d;4px):noGrow,top:4dlu:noGrow,top:max(d;25px):noGrow,top:7dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,bottom:d:grow")); panel2.putClientProperty("html.disable", Boolean.FALSE); panel1.add(panel2, BorderLayout.CENTER); final Spacer spacer5 = new Spacer(); CellConstraints cc = new CellConstraints(); panel2.add(spacer5, cc.xy(3, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); browseButton = new JButton(); browseButton.setText("Browse"); panel2.add(browseButton, cc.xy(5, 5)); comparedFileLabel = new JLabel(); comparedFileLabel.setText("Compared file :"); panel2.add(comparedFileLabel, cc.xy(3, 7, CellConstraints.LEFT, CellConstraints.TOP)); browseButton1 = new JButton(); browseButton1.setText("Browse"); panel2.add(browseButton1, cc.xy(5, 9, CellConstraints.DEFAULT, CellConstraints.TOP)); final Spacer spacer6 = new Spacer(); panel2.add(spacer6, cc.xy(3, 13, CellConstraints.DEFAULT, CellConstraints.FILL)); final Spacer spacer7 = new Spacer(); panel2.add(spacer7, cc.xy(1, 9, CellConstraints.FILL, CellConstraints.DEFAULT)); final Spacer spacer8 = new Spacer(); panel2.add(spacer8, cc.xy(7, 7, CellConstraints.FILL, CellConstraints.DEFAULT)); final JPanel panel3 = new JPanel(); panel3.setLayout(new FormLayout("fill:d:grow", "center:d:grow")); panel2.add(panel3, cc.xyw(3, 11, 3, CellConstraints.FILL, CellConstraints.FILL)); compareButton = new JButton(); compareButton.setPreferredSize(new Dimension(100, 29)); compareButton.setText("Compare"); panel3.add(compareButton, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.CENTER)); baseFileLabel = new JLabel(); baseFileLabel.setText("Base file :"); panel2.add(baseFileLabel, cc.xy(3, 3, CellConstraints.FILL, CellConstraints.FILL)); baseFileTxt = new JTextField(); baseFileTxt.setMinimumSize(new Dimension(50, 27)); baseFileTxt.setPreferredSize(new Dimension(50, 27)); panel2.add(baseFileTxt, cc.xy(3, 5, CellConstraints.FILL, CellConstraints.DEFAULT)); comparedFileTxt = new JTextField(); comparedFileTxt.setMinimumSize(new Dimension(50, 27)); comparedFileTxt.setPreferredSize(new Dimension(100, 27)); panel2.add(comparedFileTxt, cc.xy(3, 9, CellConstraints.FILL, CellConstraints.DEFAULT)); outputField = new JTextField(); outputField.setMinimumSize(new Dimension(50, 27)); outputField.setPreferredSize(new Dimension(100, 27)); panel2.add(outputField, cc.xy(3, 15, CellConstraints.FILL, CellConstraints.DEFAULT)); }