Comments (1)
Snippet to reproduce the issue:
package main;
import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
import org.eclipse.jface.fieldassist.IContentProposal;
import org.eclipse.jface.fieldassist.IContentProposalListener;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
import org.eclipse.jface.fieldassist.TextContentAdapter;
import org.eclipse.rap.rwt.application.AbstractEntryPoint;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
@SuppressWarnings({ "javadoc", "serial" })
public class Snippet extends AbstractEntryPoint
{
@Override
protected void createContents(Composite parent)
{
new Label(parent, SWT.NONE).setText("Content Proposal KeyStroke = ENTER"); //$NON-NLS-1$
Text enterTextField = new Text(parent, SWT.BORDER);
ContentProposalAdapter enterContentProposalAdapter = new ContentProposalAdapter(enterTextField,
new TextContentAdapter(), new SnippetContentProposalProvider(), KeyStroke.getInstance(SWT.CR), null);
enterContentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_IGNORE);
enterContentProposalAdapter.addContentProposalListener(new SnippetContentProposalListener());
new Label(parent, SWT.NONE).setText("Content Proposal KeyStroke = HOME"); //$NON-NLS-1$
Text escTextField = new Text(parent, SWT.BORDER);
ContentProposalAdapter escContentProposalAdapter = new ContentProposalAdapter(escTextField,
new TextContentAdapter(), new SnippetContentProposalProvider(), KeyStroke.getInstance(SWT.HOME), null);
escContentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_IGNORE);
escContentProposalAdapter.addContentProposalListener(new SnippetContentProposalListener());
}
private class SnippetContentProposalProvider implements IContentProposalProvider
{
public IContentProposal[] getProposals(String contents, int position)
{
return new SnippetContentProposal[] { new SnippetContentProposal("Proposal A"), //$NON-NLS-1$
new SnippetContentProposal("Proposal B"), new SnippetContentProposal("Proposal C") }; //$NON-NLS-1$ //$NON-NLS-2$
}
}
private class SnippetContentProposal implements IContentProposal
{
private final String label;
public SnippetContentProposal(String label)
{
this.label = label;
}
public String getContent()
{
return null;
}
public int getCursorPosition()
{
return 0;
}
public String getLabel()
{
return label;
}
public String getDescription()
{
return null;
}
}
private class SnippetContentProposalListener implements IContentProposalListener
{
public void proposalAccepted(IContentProposal proposal)
{
System.out.println("Proposal Accepted: " + ((SnippetContentProposal)proposal).getLabel()); //$NON-NLS-1$
}
}
}
from org.eclipse.rap.
Related Issues (20)
- Retry on connection error doesn't work with CSP enabled
- Handling network connection error with SeverPush active HOT 7
- Missing requirement: org.eclipse.rap.rwt.osgi 3.22.0.20220708-1200 requires 'java.package; javax.servlet [4.0.0,5.0.0)' but it could not be found HOT 3
- RAP version which support jboss8 and openjdk17 HOT 7
- Ampersand character ommited from label text HOT 1
- selection in not yet focused multiline Text widget HOT 2
- CSRF security HOT 2
- Focus issues with ContextMenu in Chrome/Edge browser
- pack column for Tableviewer
- Copy of photo is stored on server and never cleaned up
- Support for SVG Images for Actions, Commands and Menu's for HighDPI and zooming support
- Missing RAP artifacts in maven central HOT 2
- JS crash in rwt.event.DomEvent.isAltGrPressed() while drag'n'drop HOT 1
- [Grid] Index out of bounds exception when using cell selection and setItemCount HOT 2
- org.eclipse.rap.rwt.client.service.ClientInfo.getClientTimezoneOffset() returns invalid value after a daylight saving change
- Infinite loop in RAPDragTracker
- Memory leaks using Display.timerExec with push session active
- RAP version which support jboss8 HOT 17
- Improve deployment of realease artefacts to Maven Central
- Wrong handling error in ServerPush.js / Connections.js HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org.eclipse.rap.