return new KeySequence(keyStrokeArray); } catch (final IllegalArgumentException e) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); } catch (final NullPointerException e) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes);
private ContentProposalAdapter addContentAssistSimple(Text textControl) { char[] autoActivationCharacters = new char[] { '$', '{' }; KeyStroke keyStroke = null; try { keyStroke = KeyStroke.getInstance("Ctrl+Space"); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } // assume that myTextControl has already been created in some way List<Variable> variables = Variable.getVisibleVariables(); String[] proposals = new String [variables.size()]; for(int i=0;i<variables.size();i++) { proposals[i] = variables.get(i).getFullVariableName(); } ContentProposalAdapter adapter = new ContentProposalAdapter( textControl , new TextContentAdapter(), new SimpleContentProposalProvider(proposals), keyStroke, autoActivationCharacters); adapter.setPropagateKeys(false); adapter.setFilterStyle(ContentProposalAdapter.FILTER_NONE); //adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); return adapter; }
return new KeySequence(keyStrokeArray); } catch (final IllegalArgumentException e) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); } catch (final NullPointerException e) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes);
return new KeySequence(keyStrokeArray); } catch (final IllegalArgumentException e) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes); } catch (final NullPointerException e) { throw new ParseException( "Could not construct key sequence with these key strokes: " //$NON-NLS-1$ + keyStrokes);
final int modifierKey = lookup.formalModifierLookup(token); if (modifierKey == NO_KEY) { throw new ParseException( "Cannot create key stroke with duplicate or non-existent modifier key: " //$NON-NLS-1$ + token);
final int modifierKey = lookup.formalModifierLookup(token); if (modifierKey == NO_KEY) { throw new ParseException( "Cannot create key stroke with duplicate or non-existent modifier key: " //$NON-NLS-1$ + token);
final int modifierKey = lookup.formalModifierLookup(token); if (modifierKey == NO_KEY) { throw new ParseException( "Cannot create key stroke with duplicate or non-existent modifier key: " //$NON-NLS-1$ + token);