private AbstractButton createNavigationButton() { JXHyperlink b = new JXHyperlink(); b.setContentAreaFilled(false); b.setBorder(BorderFactory.createEmptyBorder()); b.setRolloverEnabled(true); b.setFocusable(false); return b; }
private JXHyperlink createZoomLink() { JXHyperlink zoomOutLink = new JXHyperlink(); Color textColor = new Color(16, 66, 104); zoomOutLink.setUnclickedColor(textColor); zoomOutLink.setClickedColor(textColor); zoomOutLink.setFocusable(false); return zoomOutLink; }
/** * Configures internally used hyperlink on new action creation and on every call to * <code>updateUI()</code>. * @param link Configured hyperlink. */ protected void configure(JXHyperlink link) { link.setOpaque(false); link.setBorderPainted(false); link.setFocusPainted(true); link.setForeground(UIManager.getColor("TaskPane.titleForeground")); }
/** * Sets the color for the previously not visited link. This value will override the one * set by the "JXHyperlink.unclickedColor" UIManager property and defaults. * * @param color Color for the hyper link if it has not yet been clicked. */ public void setUnclickedColor(Color color) { Color old = getUnclickedColor(); unclickedColor = color; if (!isClicked()) { setForeground(getUnclickedColor()); } firePropertyChange("unclickedColor", old, getUnclickedColor()); }
TodayPanel() { super(new FlowLayout()); setBackgroundPainter(new MattePainter(new GradientPaint(0, 0, new Color(238, 238, 238), 0, 1, Color.WHITE))); todayAction = new TodayAction(); todayLink = new JXHyperlink(todayAction); todayLink.addMouseListener(createDoubleClickListener()); Color textColor = new Color(16, 66, 104); todayLink.setUnclickedColor(textColor); todayLink.setClickedColor(textColor); add(todayLink); }
controlToolbar = toolbar.getControlToolbar(); localScaleButton = new javax.swing.JToggleButton(); splineButton = new org.jdesktop.swingx.JXHyperlink(); controlPanel = new javax.swing.JPanel(); applyButton = new javax.swing.JButton(); splineButton.setToolTipText(org.openide.util.NbBundle.getMessage(AppearanceTopComponent.class, "AppearanceTopComponent.splineButton.toolTipText")); // NOI18N splineButton.setClickedColor(new java.awt.Color(0, 51, 255)); splineButton.setFocusPainted(false); splineButton.setFocusable(false); splineButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); splineButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); controlToolbar.add(splineButton);
@Override protected void installDefaults(AbstractButton b) { super.installDefaults(b); JXHyperlink link = (JXHyperlink) b; LookAndFeel.installProperty(b, "opaque", false); if (SwingXUtilities.isUIInstallable(link.getUnclickedColor())) { link.setUnclickedColor(UIManager.getColor("Hyperlink.linkColor")); } if (SwingXUtilities.isUIInstallable(link.getClickedColor())) { link.setClickedColor(UIManager.getColor("Hyperlink.visitedColor")); } b.setBorderPainted(false); b.setRolloverEnabled(true); if (SwingXUtilities.isUIInstallable(b.getBorder())) { b.setBorder(new BorderUIResource(BorderFactory.createEmptyBorder(0, 1, 0, 0))); } dashedRectGapX = UIManager.getInt("ButtonUI.dashedRectGapX"); dashedRectGapY = UIManager.getInt("ButtonUI.dashedRectGapY"); dashedRectGapWidth = UIManager.getInt("ButtonUI.dashedRectGapWidth"); dashedRectGapHeight = UIManager.getInt("ButtonUI.dashedRectGapHeight"); focusColor = UIManager.getColor("ButtonUI.focus"); b.setHorizontalAlignment(SwingConstants.LEADING); }
rightMargintextField = new javax.swing.JTextField(); labelUnit = new javax.swing.JLabel(); unitLink = new org.jdesktop.swingx.JXHyperlink(); unitLink.setText(""); // NOI18N unitLink.setToolTipText(org.openide.util.NbBundle.getMessage(UIExporterPDFPanel.class, "UIExporterPDFPanel.unitLink.toolTipText")); // NOI18N unitLink.setFocusPainted(false);
edgesMergeStrategyCombo = new javax.swing.JComboBox(); graphTypeCombo = new javax.swing.JComboBox(); moreOptionsLink = new org.jdesktop.swingx.JXHyperlink(); moreOptionsPanel.add(edgesMergeStrategyCombo, gridBagConstraints); moreOptionsLink.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.moreOptionsLink.text")); // NOI18N moreOptionsLink.setClickedColor(new java.awt.Color(0, 51, 255));
JXHyperlink fileLink = new JXHyperlink(new AbstractAction() { fileLink.setText(fileName); fileLink.setToolTipText(tooltip); fileLink.putClientProperty(LINK_PATH, importer); samplesPanel.add(fileLink, "wrap");
private void loadMRU() { net.miginfocom.swing.MigLayout migLayout1 = new net.miginfocom.swing.MigLayout(); migLayout1.setColumnConstraints("[pref]"); recentPanel.setLayout(migLayout1); MostRecentFiles mru = Lookup.getDefault().lookup(MostRecentFiles.class); for (String filePath : mru.getMRUFileList()) { JXHyperlink fileLink = new JXHyperlink(openAction); File file = new File(filePath); if (file.exists()) { fileLink.setText(file.getName()); fileLink.putClientProperty(LINK_PATH, file); recentPanel.add(fileLink, "wrap"); } } }
private void showErrorMessageSunPkcs11ProviderNotAvailable() { final String sunReference = Constant.messages.getString("options.cert.error.pkcs11notavailable.sun.hyperlink"); final String ibmReference = Constant.messages.getString("options.cert.error.pkcs11notavailable.ibm.hyperlink"); Object[] hyperlinks = new Object[2]; try { JXHyperlink hyperlinkLabel = new JXHyperlink(); hyperlinkLabel.setURI(URI.create(sunReference)); hyperlinkLabel.setText(Constant.messages.getString("options.cert.error.pkcs11notavailable.sun.hyperlink.text")); hyperlinks[0] = hyperlinkLabel; hyperlinkLabel = new JXHyperlink(); hyperlinkLabel.setURI(URI.create(ibmReference)); hyperlinkLabel.setText(Constant.messages.getString("options.cert.error.pkcs11notavailable.ibm.hyperlink.text")); hyperlinks[1] = hyperlinkLabel; } catch (UnsupportedOperationException e) { // Show plain text instead of a hyperlink if the current platform doesn't support Desktop. hyperlinks[0] = sunReference; hyperlinks[1] = ibmReference; } JOptionPane.showMessageDialog(null, new Object[] { Constant.messages.getString("options.cert.error"), Constant.messages.getString("options.cert.error.pkcs11notavailable"), hyperlinks}, Constant.messages.getString("options.cert.label.client.cert"), JOptionPane.ERROR_MESSAGE); }
/** * Convenience method to create and install a HyperlinkAction for the given URI. * * @param uri * to uri to create a HyperlinkAction for, maybe null. * @throws HeadlessException * if {@link GraphicsEnvironment#isHeadless()} returns {@code true} * @throws UnsupportedOperationException * if the current platform doesn't support Desktop * * @see HyperlinkAction#createHyperlinkAction(URI) */ public void setURI(URI uri) { setAction(HyperlinkAction.createHyperlinkAction(uri)); }
model.addChangeListener(e -> dataConfiguration.setProperty(ConfKeys.JUMP_TO_CODE_PORT, model.getValue())); final JXHyperlink hyperlinkEclipse = new JXHyperlink(new AbstractAction("I'm using Eclipse") { @Override public void actionPerformed(ActionEvent e) { hyperlinkEclipse.setForeground(new Color(0x8888FF)); final JXHyperlink hyperlinkIntellij = new JXHyperlink(new AbstractAction("I'm using Intellij IDEA") { @Override public void actionPerformed(ActionEvent e) { hyperlinkIntellij.setForeground(new Color(0x8888FF)); jumpToCodeService = new JumpToCodeServiceImpl(dataConfiguration); testIdeIntegration = new JButton("Test IDE integration", Icons.STATUS_UNKNOWN);
rendererComponent.setForeground(linkAction.isVisited() ? rendererComponent.getClickedColor() : rendererComponent.getUnclickedColor()); } else { rendererComponent.setForeground(context.getSelectionForeground());
for(int i=1; i<=lcol-1;i++) { a2=sheet.getCell(i,0); stringy=a2.getContents(); testlink= new JXHyperlink(new Action(stringy)); // I'm the JList, not it's model :P list.add(testlink); } // I bet nothing exists in the model for(int i=0;i<list.getModel().getSize();i++) { panel2.add(list.getModel().getElementAt(i)); }
/** * {@inheritDoc} <p> * Overridden to update the link format and hyperlink text. */ @Override public void setLocale(Locale l) { super.setLocale(l); updateLinkFormat(); todayLink.setText(getLinkFormat().format(new Object[]{getLinkDay()})); }
/** * Read all the essential properties from the provided <code>Action</code> * and apply it to the <code>JXHyperlink</code> */ @Override protected void configurePropertiesFromAction(Action a) { super.configurePropertiesFromAction(a); configureClickedPropertyFromAction(a); }
@Override public void doClick() { rendererComponent.doClick(); }