org.eclipse.ui.help.IWorkbenchHelpSystem Java Examples

The following examples show how to use org.eclipse.ui.help.IWorkbenchHelpSystem. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UIUtils.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Opens the internal help in the Studio's internal browser.
 * 
 * @param url
 * @return A boolean value indicating a successful operations or not.
 */
public static boolean openHelpInBrowser(String url)
{
	IWorkbench workbench = PlatformUI.getWorkbench();
	if (workbench != null)
	{
		IWorkbenchHelpSystem helpSystem = workbench.getHelpSystem();
		URL resolvedURL = helpSystem.resolve(url, true);
		if (resolvedURL != null)
		{
			return openInBroswer(resolvedURL, true, IWorkbenchBrowserSupport.AS_EDITOR
					| IWorkbenchBrowserSupport.STATUS);
		}
		else
		{
			IdeLog.logError(UIPlugin.getDefault(), "Unable to resolve the Help URL for " + url); //$NON-NLS-1$
			return false;
		}
	}
	return false;
}
 
Example #2
Source File: HelpHoverProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void run() {
	final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
	if (contextId == null) {
		helpSystem.displayHelp();
	} else {
		helpSystem.displayHelp(contextId);
	}
}
 
Example #3
Source File: CustomCSSHelpHoverProvider.java    From solidity-ide with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void run() {
	final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench()
			.getHelpSystem();
	helpSystem.displayHelp("org.yakindu.sct.ui.editor.stext_keyword");
}
 
Example #4
Source File: TexEditorPreferencePage.java    From texlipse with Eclipse Public License 1.0 4 votes vote down vote up
/**
    * Creates the field editors. Field editors are abstractions of
    * the common GUI blocks needed to manipulate various types
    * of preferences. Each field editor knows how to save and
    * restore itself.
    */
public void createFieldEditors() {
       
       TexlipsePreferencePage.addSpacer(getFieldEditorParent());
       addField(new BooleanFieldEditor(TexlipseProperties.TEX_COMPLETION, TexlipsePlugin.getResourceString("preferenceTexCompletion"), getFieldEditorParent()));
       String completionMessage = TexlipsePlugin.getResourceString("preferenceTexCompletionDelay").replaceFirst("%1", "" + MIN_COMPLETION_DELAY).replaceFirst("%2", "" + MAX_COMPLETION_DELAY);
       IntegerFieldEditor completionDelay = new IntegerFieldEditor(TexlipseProperties.TEX_COMPLETION_DELAY, completionMessage, getFieldEditorParent());
       completionDelay.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE);
       completionDelay.setValidRange(MIN_COMPLETION_DELAY, MAX_COMPLETION_DELAY);
       addField(completionDelay);
       //TexlipsePreferencePage.addSpacer(getFieldEditorParent());
       
       // auto \item completion
       addField(new BooleanFieldEditor(TexlipseProperties.TEX_ITEM_COMPLETION,
               TexlipsePlugin.getResourceString("preferenceTexItemCompletion"),
               getFieldEditorParent()));
       Label itemLabel = new Label(getFieldEditorParent(), SWT.LEFT | SWT.WRAP);
       itemLabel.setText(TexlipsePlugin.getResourceString("preferenceTexItemCompletionText"));        
       //TexlipsePreferencePage.addSpacer(getFieldEditorParent());
               
       // auto parsing
       addField(new BooleanFieldEditor(TexlipseProperties.AUTO_PARSING,
               TexlipsePlugin.getResourceString("preferenceAutoParsing"),
               getFieldEditorParent()));
       String autoParsingMessage = TexlipsePlugin.getResourceString(
               "preferenceAutoParsingDelay").replaceFirst("%1",
               "" + MIN_AUTO_DELAY).replaceFirst("%2", "" + MAX_AUTO_DELAY);
       IntegerFieldEditor autoDelay = new IntegerFieldEditor(TexlipseProperties.AUTO_PARSING_DELAY,
               autoParsingMessage, getFieldEditorParent());
       autoDelay.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE);
       autoDelay.setValidRange(MIN_AUTO_DELAY, MAX_AUTO_DELAY);
       addField(autoDelay);
       
       // Check for missing sections
       addField(new BooleanFieldEditor(TexlipseProperties.SECTION_CHECK,
               TexlipsePlugin.getResourceString("preferenceSectionCheck"),
               getFieldEditorParent()));

       // Mark occurences (references and environments)
       addField(new BooleanFieldEditor(TexlipseProperties.TEX_EDITOR_ANNOTATATIONS,
               TexlipsePlugin.getResourceString("preferencesEditorHighlighting"),
               getFieldEditorParent()));
       
       TexlipsePreferencePage.addSpacer(getFieldEditorParent());
       
       // word wrapping
       Group group = new Group(getFieldEditorParent(), SWT.NONE);
       group.setText(TexlipsePlugin.getResourceString("preferenceWrapping"));
       group.setLayout(new GridLayout());
       GridData layData = new GridData(GridData.FILL_HORIZONTAL);
       layData.horizontalSpan = 2;
       group.setLayoutData(layData);
       
       Composite wordWrapParent = getFieldEditorParent(group);

       // default on/off wrapping
       addField(new BooleanFieldEditor(TexlipseProperties.WORDWRAP_DEFAULT, TexlipsePlugin.getResourceString("preferenceWrappingDefault"), wordWrapParent));
       TexlipsePreferencePage.addSpacer(wordWrapParent);
       
       String message = TexlipsePlugin.getResourceString("preferenceWrapLineLength").replaceFirst("%1", ""+MIN_WRAP_LENGTH).replaceFirst("%2", ""+MAX_WRAP_LENGTH);
       IntegerFieldEditor wordWrapLength = new IntegerFieldEditor(TexlipseProperties.WORDWRAP_LENGTH, message, wordWrapParent);
       wordWrapLength.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE);
       wordWrapLength.setValidRange(MIN_WRAP_LENGTH, MAX_WRAP_LENGTH);
       addField(wordWrapLength);
       
       IWorkbenchHelpSystem helpsystem = workbench.getHelpSystem();
       helpsystem.setHelp(wordWrapLength.getTextControl(wordWrapParent), TexlipseHelpIds.WRAP_LENGTH);
       
       //WorkbenchHelp.setHelp(wordWrapLength.getTextControl(wordWrapParent), TexlipseHelpIds.WRAP_LENGTH);
       
       TexlipsePreferencePage.addSpacer(wordWrapParent);
       Label label = new Label(wordWrapParent, SWT.LEFT | SWT.WRAP);
       label.setText(TexlipsePlugin.getResourceString("preferenceWrapSoftWarning"));
       GridData lgl = new GridData(GridData.FILL_HORIZONTAL);
       lgl.horizontalSpan = 2;
       label.setLayoutData(lgl);
       addField(new RadioGroupFieldEditor(TexlipseProperties.WORDWRAP_TYPE, TexlipsePlugin.getResourceString("preferenceWrapType"), 1, 
                                          new String[][] {//{ TexlipsePlugin.getResourceString("preferenceWrapNoneLabel"), TexlipseProperties.WORDWRAP_TYPE_NONE },
                                                          { TexlipsePlugin.getResourceString("preferenceWrapSoftLabel"), TexlipseProperties.WORDWRAP_TYPE_SOFT }, 
                                                          { TexlipsePlugin.getResourceString("preferenceWrapHardLabel"), TexlipseProperties.WORDWRAP_TYPE_HARD }},
                                                          getFieldEditorParent(group)));
   }
 
Example #5
Source File: AbstractEditorPropertySection.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
protected void setHelpContext(Control control, String helpId) {
	IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
	helpSystem.setHelp(control, helpId);
}
 
Example #6
Source File: StatechartDiagramEditor.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected void createGraphicalViewer(Composite parent) {
	super.createGraphicalViewer(parent);
	IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
	helpSystem.setHelp(getGraphicalViewer().getControl(), HelpContextIds.SC_EDITOR_GRAPHICAL_VIEWER);
}