private void updateAssistProperties(PropertyChangeEvent event) {
String key = event.getProperty();
try {
// auto activation delay
if (key.equals(HTMLPlugin.PREF_ASSIST_TIMES)) {
ContentAssistant assistant = (ContentAssistant) getSourceViewerConfiguration().getContentAssistant(null);
assistant.setAutoActivationDelay(Integer.parseInt((String) event.getNewValue()));
// auto activation trigger
}
else if (key.equals(HTMLPlugin.PREF_ASSIST_CHARS)) {
ContentAssistant assistant = (ContentAssistant) getSourceViewerConfiguration().getContentAssistant(null);
HTMLAssistProcessor processor = (HTMLAssistProcessor) assistant.getContentAssistProcessor(IDocument.DEFAULT_CONTENT_TYPE);
processor.setAutoAssistChars(((String) event.getNewValue()).toCharArray());
// completion close tag
}
else if (key.equals(HTMLPlugin.PREF_ASSIST_CLOSE)) {
ContentAssistant assistant = (ContentAssistant) getSourceViewerConfiguration().getContentAssistant(null);
HTMLAssistProcessor processor = (HTMLAssistProcessor) assistant.getContentAssistProcessor(IDocument.DEFAULT_CONTENT_TYPE);
processor.setAssistCloseTag(((Boolean) event.getNewValue()).booleanValue());
// enable auto activation or not
}
else if (key.equals(HTMLPlugin.PREF_ASSIST_AUTO)) {
ContentAssistant assistant = (ContentAssistant) getSourceViewerConfiguration().getContentAssistant(null);
assistant.enableAutoActivation(((Boolean) event.getNewValue()).booleanValue());
}
}
catch (Exception ex) {
HTMLPlugin.logException(ex);
}