popupSize = getShell().getSize(); if (infoPopup != null) { infoPopup.adjustBounds();
if (description != null) { if (infoPopup == null) { infoPopup = new InfoPopupDialog( getShell()); infoPopup.open(); infoPopup .getShell() .addDisposeListener( event -> infoPopup = null); infoPopup.setContents(p .getDescription()); } else if (infoPopup != null) { infoPopup.close();
if (activeShell == getShell() || (infoPopup != null && infoPopup .getShell() == activeShell)) { return;
popupSize = getShell().getSize(); if (infoPopup != null) { infoPopup.adjustBounds();
@Override protected void adjustBounds() { Rectangle parentBounds = getParentShell().getBounds(); Rectangle proposedBounds; + PopupDialog.POPUP_VERTICALSPACING, parentBounds.width, parentBounds.height); rightProposedBounds = getConstrainedShellBounds(rightProposedBounds); parentBounds.y, parentBounds.width, parentBounds.height); leftProposedBounds = getConstrainedShellBounds(leftProposedBounds); getShell().setBounds(proposedBounds);
if (activeShell == getShell() || (infoPopup != null && infoPopup .getShell() == activeShell)) { return;
@Override protected void adjustBounds() { Rectangle parentBounds = getParentShell().getBounds(); Rectangle proposedBounds; + PopupDialog.POPUP_VERTICALSPACING, parentBounds.width, parentBounds.height); rightProposedBounds = getConstrainedShellBounds(rightProposedBounds); parentBounds.y, parentBounds.width, parentBounds.height); leftProposedBounds = getConstrainedShellBounds(leftProposedBounds); getShell().setBounds(proposedBounds);
@Override protected void adjustBounds() { Rectangle parentBounds = getParentShell().getBounds(); Rectangle proposedBounds; + PopupDialog.POPUP_VERTICALSPACING, parentBounds.width, parentBounds.height); rightProposedBounds = getConstrainedShellBounds(rightProposedBounds); parentBounds.y, parentBounds.width, parentBounds.height); leftProposedBounds = getConstrainedShellBounds(leftProposedBounds); getShell().setBounds(proposedBounds);
if (description != null) { if (infoPopup == null) { infoPopup = new InfoPopupDialog(getShell()); infoPopup.open(); infoPopup.getShell() .addDisposeListener(event -> infoPopup = null); infoPopup.setContents(p.getDescription()); } else if (infoPopup != null) { infoPopup.close();
infoPopup.close();
private void setProposals(IContentProposal[] newProposals) { if (newProposals == null || newProposals.length == 0) { newProposals = getEmptyProposalArray(); } this.proposals = newProposals; // If there is a table if (isValid()) { final int newSize = newProposals.length; // Set and clear the virtual table. Data will be // provided in the SWT.SetData event handler. proposalTable.setItemCount(newSize); proposalTable.clearAll(); // Default to the first selection if there is content. if (newProposals.length > 0) { selectProposal(0); } else { // No selection, close the secondary popup if it was open if (infoPopup != null) { infoPopup.close(); } } } }
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(); } } });
/** * Closes this popup. This method is extended to remove the control * listener. * * @return <code>true</code> if the window is (or was already) closed, * and <code>false</code> if it is still open */ @Override public boolean close() { popupCloser.removeListeners(); if (infoPopup != null) { infoPopup.close(); } boolean ret = super.close(); notifyPopupClosed(); // RAP [if] Use CANCEL_KEYS instead of doit = false updateCancelKeys( false, CANCEL_KEYS ); // ENDRAP return ret; }
/** * Closes this popup. This method is extended to remove the control * listener. * * @return <code>true</code> if the window is (or was already) closed, * and <code>false</code> if it is still open */ @Override public boolean close() { popupCloser.removeListeners(); if (infoPopup != null) { infoPopup.close(); } boolean ret = super.close(); notifyPopupClosed(); return ret; }
/** * Closes this popup. This method is extended to remove the control * listener. * * @return <code>true</code> if the window is (or was already) closed, * and <code>false</code> if it is still open */ @Override public boolean close() { popupCloser.removeListeners(); if (infoPopup != null) { infoPopup.close(); } boolean ret = super.close(); notifyPopupClosed(); return ret; }
public void widgetSelected(SelectionEvent e) { // If a proposal has been selected, show it in the secondary // popup. Otherwise close the popup. if (e.item == null) { if (infoPopup != null) { infoPopup.close(); } } else { showProposalDescription(); } }
private boolean hasFocus() { if (!isValid()) { return false; } if (getShell().isFocusControl() || proposalTable.isFocusControl()) { return true; } if (infoPopup != null && infoPopup.hasFocus()) { return true; } return false; }
@Override public void widgetSelected(SelectionEvent e) { // If a proposal has been selected, show it in the secondary // popup. Otherwise close the popup. if (e.item == null) { if (infoPopup != null) { infoPopup.close(); } } else { showProposalDescription(); } }
private boolean hasFocus() { if (!isValid()) { return false; } if (getShell().isFocusControl() || proposalTable.isFocusControl()) { return true; } if (infoPopup != null && infoPopup.hasFocus()) { return true; } return false; }