public void startSearch(String newPhrase, IContext excludeContext) { if (phrase!=null && phrase.equals(newPhrase)) return; this.phrase = newPhrase; this.context = excludeContext; if (getSection().isExpanded()) startInPlaceSearch(phrase, excludeContext); }
public boolean hasFocusControl(Control control) { return contextHelpPart.hasFocusControl(control) || dynamicHelpPart.hasFocusControl(control); }
public void toggleRoleFilter() { refilter(); }
if (isExcluded(hit.getHref(), excludedTopics)) continue; if (i==SHORT_COUNT) searchResults.setText("", false, false); //$NON-NLS-1$ if (!searchResults.isDisposed()) getManagedForm().reflow(true);
public Control getControl() { return getSection(); }
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { Point topSize = contextHelpPart.getControl().computeSize(wHint, hHint, flushCache); Point botSize = dynamicHelpPart.getControl().computeSize(wHint, hHint, flushCache); Point size = new Point(0, 0); size.x = Math.max(topSize.x, botSize.x); size.y = VSPACE + topSize.y + VSPACE + botSize.y; return size; }
public RelatedTopicsPart(Composite parent, FormToolkit toolkit) { ScrolledForm form = toolkit.createScrolledForm(parent); mform = new ManagedForm(toolkit, form) { public void reflow(boolean changed) { super.reflow(changed); RelatedTopicsPart.this.parent.reflow(); } }; form.getBody().setLayout(new RelatedLayout()); contextHelpPart = new ContextHelpPart(form.getBody(), toolkit); dynamicHelpPart = new DynamicHelpPart(form.getBody(), toolkit); }
void scheduleSearch(Job job) { if (runningJob != null) { runningJob.cancel(); } StringBuffer buff = new StringBuffer(); buff.append("<form>"); //$NON-NLS-1$ buff.append("<p><span color=\""); //$NON-NLS-1$ buff.append(IFormColors.TITLE); buff.append("\">"); //$NON-NLS-1$ buff.append(Messages.SearchResultsPart_progress); buff.append("</span>"); //$NON-NLS-1$ buff.append("<a href=\""); //$NON-NLS-1$ buff.append(CANCEL_HREF); buff.append("\">"); //$NON-NLS-1$ buff.append(Messages.SearchResultsPart_cancel); buff.append("</a></p>"); //$NON-NLS-1$ buff.append("</form>"); //$NON-NLS-1$ searchResults.setText(buff.toString(), true, false); getManagedForm().reflow(true); runningJob = job; job.schedule(); }
public void linkActivated(HyperlinkEvent e) { Object href = e.getHref(); if (href.equals(CANCEL_HREF)) { if (runningJob != null) { runningJob.cancel(); runningJob = null; } clearResults(); } else if (href.equals(MORE_HREF)) { doMore(); } else doOpenLink(e.getHref()); } public void linkEntered(HyperlinkEvent e) {
public void init(ReusableHelpPart parent, String id, IMemento memento) { this.parent = parent; this.id = id; contextHelpPart.init(parent, IHelpUIConstants.HV_CONTEXT_HELP, memento); dynamicHelpPart.init(parent, IHelpUIConstants.HV_SEARCH_RESULT, memento); mform.addPart(contextHelpPart); mform.addPart(dynamicHelpPart); mform.initialize(); }
public boolean fillContextMenu(IMenuManager manager) { Control focusControl = mform.getForm().getDisplay().getFocusControl(); if (contextHelpPart.hasFocusControl(focusControl)) return contextHelpPart.fillContextMenu(manager); return dynamicHelpPart.fillContextMenu(manager); }
private void updateResults(final String phrase, final IContext excludeContext, final StringBuffer buffer, final SearchHit[] hits) { if (getSection().isDisposed()) return; getSection().getDisplay().asyncExec(new Runnable() { public void run() { doUpdateResults(phrase, excludeContext, buffer, hits); } }); }
protected void layout(Composite composite, boolean flushCache) { Rectangle carea = composite.getClientArea(); Point topSize = contextHelpPart.getControl().computeSize( carea.width, SWT.DEFAULT, flushCache); Point botSize = dynamicHelpPart.getControl().computeSize( carea.width, SWT.DEFAULT, flushCache); int y = VSPACE; contextHelpPart.getControl().setBounds(0, y, carea.width, topSize.y); y += topSize.y + VSPACE; dynamicHelpPart.getControl().setBounds(0, y, carea.width, botSize.y); }
part = new BrowserPart(parent, mform.getToolkit(), tbm); } else if (id.equals(HV_SEARCH_RESULT)) { part = new DynamicHelpPart(parent, mform.getToolkit()); } else if (id.equals(HV_FSEARCH_RESULT)) { part = new SearchResultsPart(parent, mform.getToolkit(), tbm);
void clearResults() { if (runningJob != null) { runningJob.cancel(); runningJob = null; } searchResults.setText("", false, false); //$NON-NLS-1$ getManagedForm().reflow(true); }
public void setVisible(boolean visible) { getSection().setVisible(visible); }
public void expansionStateChanged(ExpansionEvent e) { if (e.getState()) { refilter(); } } });
| Section.TITLE_BAR); Section section = getSection(); section.setText(Messages.SearchPart_title); section.marginWidth = 5;
public void refilter() { contextHelpPart.refilter(); dynamicHelpPart.refilter(); } public boolean setFormInput(Object input) {