public void run() { if (isValid()) { if (scrollbarClicked || hasFocus()) { return; } // Workaround a problem on X and Mac, whereby at // this point, the focus control is not known. // This can happen, for example, when resizing // the popup shell on the Mac. // Check the active shell. Shell activeShell = e.display.getActiveShell(); if (activeShell == getShell() || (infoPopup != null && infoPopup .getShell() == activeShell)) { return; } /* * System.out.println(e); * System.out.println(e.display.getFocusControl()); * System.out.println(e.display.getActiveShell()); */ close(); } } });
/** * Set the boolean flag that determines whether the adapter is enabled. * * @param enabled * <code>true</code> if the adapter is enabled and responding * to user input, <code>false</code> if it is ignoring user * input. * */ public void setEnabled(boolean enabled) { // If we are disabling it while it's proposing content, close the // content proposal popup. if (isEnabled && !enabled) { if (popup != null) { popup.close(); } } isEnabled = enabled; }
/** * Set the boolean flag that determines whether the adapter is enabled. * * @param enabled * <code>true</code> if the adapter is enabled and responding * to user input, <code>false</code> if it is ignoring user * input. * */ public void setEnabled(boolean enabled) { // If we are disabling it while it's proposing content, close the // content proposal popup. if (isEnabled && !enabled) { if (popup != null) { popup.close(); } } isEnabled = enabled; }
/** * Set the boolean flag that determines whether the adapter is enabled. * * @param enabled * <code>true</code> if the adapter is enabled and responding * to user input, <code>false</code> if it is ignoring user * input. * */ public void setEnabled(boolean enabled) { // If we are disabling it while it's proposing content, close the // content proposal popup. if (isEnabled && !enabled) { if (popup != null) { popup.close(); } } isEnabled = enabled; }
private void recomputeProposals(String filterText) { IContentProposal[] allProposals = getProposals(); if (allProposals == null) allProposals = getEmptyProposalArray(); // If the non-filtered proposal list is empty, we should // close the popup. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=147377 if (allProposals.length == 0) { proposals = allProposals; close(); } else { // Keep the popup open, but filter by any provided filter text setProposals(filterProposals(allProposals, filterText)); } }
private void recomputeProposals(String filterText) { IContentProposal[] allProposals = getProposals(); if (allProposals == null) allProposals = getEmptyProposalArray(); // If the non-filtered proposal list is empty, we should // close the popup. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=147377 if (allProposals.length == 0) { proposals = allProposals; close(); } else { // Keep the popup open, but filter by any provided filter text setProposals(filterProposals(allProposals, filterText)); } }
private void recomputeProposals(String filterText) { IContentProposal[] allProposals = getProposals(); if (allProposals == null) { allProposals = getEmptyProposalArray(); } // If the non-filtered proposal list is empty, we should // close the popup. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=147377 if (allProposals.length == 0) { proposals = allProposals; close(); } else { // Keep the popup open, but filter by any provided filter text setProposals(filterProposals(allProposals, filterText)); } }
/** * Close the proposal popup without accepting a proposal. This method * returns immediately, and has no effect if the proposal popup was not * open. This method is used by subclasses to explicitly close the popup * based on additional logic. * * @since 3.3 */ protected void closeProposalPopup() { if (popup != null) { popup.close(); } }
/** * Close the proposal popup without accepting a proposal. This method * returns immediately, and has no effect if the proposal popup was not * open. This method is used by subclasses to explicitly close the popup * based on additional logic. * * @since 1.0 */ protected void closeProposalPopup() { if (popup != null) { popup.close(); } }
@Override public void focusGained(FocusEvent event) { ContentProposalPopup.this.close(); } });
private void acceptCurrentProposal() { // Close before accepting the proposal. This is important // so that the cursor position can be properly restored at // acceptance, which does not work without focus on some controls. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127108 IContentProposal proposal = getSelectedProposal(); close(); proposalAccepted(proposal); }
private void acceptCurrentProposal() { // Close before accepting the proposal. This is important // so that the cursor position can be properly restored at // acceptance, which does not work without focus on some controls. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127108 IContentProposal proposal = getSelectedProposal(); close(); proposalAccepted(proposal); }
private void acceptCurrentProposal() { // Close before accepting the proposal. This is important // so that the cursor position can be properly restored at // acceptance, which does not work without focus on some controls. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127108 IContentProposal proposal = getSelectedProposal(); close(); proposalAccepted(proposal); }
/** * Close the proposal popup without accepting a proposal. This method * returns immediately, and has no effect if the proposal popup was not * open. This method is used by subclasses to explicitly close the popup * based on additional logic. * * @since 3.3 */ protected void closeProposalPopup() { if (popup != null) { popup.close(); } }
@Override public void focusGained(FocusEvent event) { ContentProposalPopup.this.close(); } });
@Override public void focusGained(FocusEvent event) { ContentProposalPopup.this.close(); } });