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


Java LaunchBrowser類代碼示例

本文整理匯總了Java中edu.umd.cs.findbugs.util.LaunchBrowser的典型用法代碼示例。如果您正苦於以下問題:Java LaunchBrowser類的具體用法?Java LaunchBrowser怎麽用?Java LaunchBrowser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LaunchBrowser類屬於edu.umd.cs.findbugs.util包,在下文中一共展示了LaunchBrowser類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addLink

import edu.umd.cs.findbugs.util.LaunchBrowser; //導入依賴的package包/類
private void addLink(JComponent component, URL source) {
    this.sourceLink = source;
    component.setEnabled(true);
    if (!listenerAdded) {
        listenerAdded = true;
        component.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                URL u = sourceLink;
                if (u != null)
                    LaunchBrowser.showDocument(u);

            }
        });
    }
    component.setCursor(new Cursor(Cursor.HAND_CURSOR));
    Cloud plugin = mainFrame.getBugCollection().getCloud();
    if (plugin != null)
        component.setToolTipText(plugin.getSourceLinkToolTip(null));

}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:22,代碼來源:MainFrameComponentFactory.java

示例2: createPluginUpdateButton

import edu.umd.cs.findbugs.util.LaunchBrowser; //導入依賴的package包/類
private JButton createPluginUpdateButton(final JPanel comp, final UpdateChecker.PluginUpdate update) {
    JButton button = new JButton("<html><u><font color=#0000ff>More info...");
    button.setBorderPainted(false);
    button.setOpaque(false);
    button.setContentAreaFilled(false);
    button.setBackground(comp.getBackground());
    button.setToolTipText(update.getUrl());
    button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            boolean failed;
            String url = update.getUrl();
            try {
                failed = url == null || !LaunchBrowser.showDocument(new URL(url));
            } catch (MalformedURLException e1) {
                failed = true;
            }
            if (failed)
                JOptionPane.showMessageDialog(comp, "Could not open URL " + url);
        }
    });
    return button;
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:24,代碼來源:PluginUpdateDialog.java

示例3: signIn

import edu.umd.cs.findbugs.util.LaunchBrowser; //導入依賴的package包/類
public boolean signIn(CloudPlugin plugin, BugCollection bugCollection) throws IOException {
    loadProperties(plugin);

    if (softSignin())
        return true;

    if (sessionId == null)
        sessionId = loadOrCreateSessionId();

    LOGGER.info("Opening browser for session " + sessionId);
    URL u = new URL(url + "/browser-auth/" + sessionId);
    LaunchBrowser.showDocument(u);

    // wait 1 minute for the user to sign in
    for (int i = 0; i < USER_SIGNIN_TIMEOUT_SECS; i++) {
        if (checkAuthorized(getAuthCheckUrl(sessionId))) {
            return true;
        }
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            break;
        }
    }
    LOGGER.info("Sign-in timed out for " + sessionId);
    throw new IOException("Sign-in timed out");
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:28,代碼來源:WebCloudNameLookup.java

示例4: editorPaneHyperlinkUpdate

import edu.umd.cs.findbugs.util.LaunchBrowser; //導入依賴的package包/類
private void editorPaneHyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {//GEN-FIRST:event_editorPaneHyperlinkUpdate
    try {
        if (evt.getEventType().equals( HyperlinkEvent.EventType.ACTIVATED)) {
            URL url = evt.getURL();
            LaunchBrowser.showDocument(url);
        }
    }
    catch (Exception e) {
    }
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:11,代碼來源:AboutDialog.java

示例5: editorPaneHyperlinkUpdate

import edu.umd.cs.findbugs.util.LaunchBrowser; //導入依賴的package包/類
static void editorPaneHyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {// GEN-FIRST:event_editorPaneHyperlinkUpdate
    try {
        if (evt.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
            URL url = evt.getURL();
            LaunchBrowser.showDocument(url);
        }
    } catch (Exception e) {
    }
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:10,代碼來源:AboutDialog.java

示例6: showDocument

import edu.umd.cs.findbugs.util.LaunchBrowser; //導入依賴的package包/類
public boolean showDocument(URL u) {
    return LaunchBrowser.showDocument(u);
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:4,代碼來源:AbstractSwingGuiCallback.java

示例7: createCommentsInputPanel

import edu.umd.cs.findbugs.util.LaunchBrowser; //導入依賴的package包/類
JPanel createCommentsInputPanel() {
    JPanel mainPanel = new JPanel();
    GridBagLayout layout = new GridBagLayout();

    mainPanel.setLayout(layout);

    fileBug = new JButton(BugFilingStatus.FILE_BUG.toString());
    fileBug.setEnabled(false);
    fileBug.setToolTipText("Click to file bug for this issue");
    fileBug.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (frame.getCurrentSelectedBugLeaf() == null) {
                return;
            }
            if (!canNavigateAway())
                return;
            BugInstance bug = frame.getCurrentSelectedBugLeaf().getBug();
            Cloud cloud1 = MainFrame.getInstance().getBugCollection().getCloud();
            if (!cloud1.supportsBugLinks())
                return;
            try {
                URL u = cloud1.getBugLink(bug);
                if (u != null) {
                    if (LaunchBrowser.showDocument(u)) {
                        cloud1.bugFiled(bug, null);
                        MainFrame.getInstance().syncBugInformation();
                    }
                }
            } catch (Exception e1) {
                LOGGER.log(Level.SEVERE, "Could not view/file bug", e1);
                JOptionPane.showMessageDialog(MainFrame.getInstance(),
                        "Could not view/file bug:\n" + e1.getClass().getSimpleName()
                        + ": " + e1.getMessage());
            }
        }
    });

    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 0;
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1;
    c.weighty = 1;

    commentsPane = new CloudCommentsPaneSwing();
    mainPanel.add(new JScrollPane(commentsPane), c);

    c.gridy++;
    c.weightx = 0;
    c.weighty = 0;
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.EAST;
    mainPanel.add(fileBug, c);

    return mainPanel;
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:58,代碼來源:CommentsArea.java


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