} catch (InterruptedException e) { if (!isValid()) { return; getShell().getDisplay().syncExec(() -> { IContentProposal p = getSelectedProposal(); if (p != null) { String description = p.getDescription(); if (infoPopup == null) { infoPopup = new InfoPopupDialog( getShell()); infoPopup.open(); infoPopup
private IContentProposal[] filterProposals( IContentProposal[] proposals, String filterString) { if (filterString.length() == 0) { return proposals; } // Check each string for a match. Use the string displayed to the // user, not the proposal content. ArrayList<IContentProposal> list = new ArrayList<>(); for (int i = 0; i < proposals.length; i++) { String string = getString(proposals[i]); if (string.length() >= filterString.length() && string.substring(0, filterString.length()) .equalsIgnoreCase(filterString)) { list.add(proposals[i]); } } return list.toArray(new IContentProposal[list .size()]); }
popup.getTargetControlListener().handleEvent(e); if (DEBUG) { StringBuffer sb; popup.getTargetControlListener().handleEvent( e );
popup.getTargetControlListener().handleEvent(e); if (DEBUG) { StringBuffer sb;
popup.getTargetControlListener().handleEvent(e); if (DEBUG) { StringBuilder sb;
return; Display display = getShell().getDisplay(); display.syncExec(new Runnable() { public void run() {
POPUP_MINIMUM_WIDTH); proposalTable.setLayoutData(data); getShell().pack(); popupSize = getShell().getSize(); Rectangle constrainedBounds = getConstrainedShellBounds(new Rectangle(initialX, initialY, popupSize.x, popupSize.y)); getShell().setBounds(initialX, location.y - popupSize.y, popupSize.x, popupSize.y); else getShell().setBounds(initialX, initialY, popupSize.x, popupSize.y); getShell().addListener(SWT.Resize, e -> { popupSize = getShell().getSize(); if (infoPopup != null) { infoPopup.adjustBounds();
POPUP_MINIMUM_WIDTH); proposalTable.setLayoutData(data); getShell().pack(); popupSize = getShell().getSize(); Rectangle constrainedBounds = getConstrainedShellBounds(new Rectangle(initialX, initialY, popupSize.x, popupSize.y)); getShell().setBounds(initialX, location.y - popupSize.y, popupSize.x, popupSize.y); else getShell().setBounds(initialX, initialY, popupSize.x, popupSize.y); getShell().addListener(SWT.Resize, e -> { popupSize = getShell().getSize(); if (infoPopup != null) { infoPopup.adjustBounds();
setProposals(filterProposals(proposals, filterText));
POPUP_MINIMUM_WIDTH); proposalTable.setLayoutData(data); getShell().pack(); popupSize = getShell().getSize(); Rectangle constrainedBounds = getConstrainedShellBounds(new Rectangle(initialX, initialY, popupSize.x, popupSize.y)); getShell().setBounds(initialX, location.y - popupSize.y, popupSize.x, popupSize.y); } else { getShell().setBounds(initialX, initialY, popupSize.x, popupSize.y); getShell().addListener(SWT.Resize, new Listener() { public void handleEvent(Event e) { popupSize = getShell().getSize();
private void setProposals(IContentProposal[] newProposals) { if (newProposals == null || newProposals.length == 0) { newProposals = getEmptyProposalArray(); if (isValid()) { final int newSize = newProposals.length; if (USE_VIRTUAL) { TableItem item = items[i]; IContentProposal proposal = newProposals[i]; item.setText(getString(proposal)); item.setImage(getImage(proposal)); item.setData(proposal); selectProposal(0); } else {
| SWT.VIRTUAL); Listener listener = event -> handleSetData(event); proposalTable.addListener(SWT.SetData, listener); } else { setProposals(filterProposals(proposals, filterText));
popup = new ContentProposalPopup(null, proposals); popup.open(); popup.getShell().addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent event) { popup = null;
popup = new ContentProposalPopup(null, proposals); popup.open(); popup.getShell().addDisposeListener(event -> popup = null); internalPopupOpened(); notifyPopupOpened();
popup = new ContentProposalPopup(null, proposals); popup.open(); popup.getShell().addDisposeListener(event -> popup = null); internalPopupOpened(); notifyPopupOpened();