/** DOC amaumont Comment method "initProposal". */ private void initProposal() { if (contentProposalAdapter == null) { contentProposalAdapter = ProposalUtils.getCommonProposal(textCellEditor); contentProposalAdapter.addContentProposalListener( new IContentProposalExtendedListener() { public void proposalBeforeModifyControl(IContentProposal proposal) { if (!text.isFocusControl() && contentProposalAdapter.hasFocus()) { activateCellEditor(); text.setSelection( new Point(selectionBeforeFocusLost.x, selectionBeforeFocusLost.y)); } } public void proposalClosed() {} public void proposalOpened() {} public void proposalAccepted(IContentProposal proposal) { selectionBeforeFocusLost = text.getSelection(); activateCellEditorAsynch(null, false); } }); } }
protected void keyReleaseOccured(KeyEvent keyEvent) { boolean proposalOpened = contentProposalAdapter.isProposalOpened(); if (!proposalOpened) { if (keyEvent.character == '\r') { // Return key if (text != null && !text.isDisposed() && (text.getStyle() & SWT.MULTI) != 0) { if ((keyEvent.stateMask & SWT.CTRL) != 0) { return; } } keyEvent.doit = false; } cellEditorClassKeyReleasedOccured(keyEvent); } }
public void setContentProposalProvider(IContentProposalProvider proposalProvider) { if (contentProposalAdapter != null) { contentProposalAdapter.setContentProposalProvider(proposalProvider); } }
public IContentProposalProvider getProposalProvider() { if (contentProposalAdapter != null) { return contentProposalAdapter.getContentProposalProvider(); } return null; }