Java Code Examples for org.eclipse.swt.browser.Browser#setText()

The following examples show how to use org.eclipse.swt.browser.Browser#setText() . 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: AboutDialog.java    From http4e with Apache License 2.0 7 votes vote down vote up
protected Control createDialogArea( Composite parent){
   Composite composite = (Composite) super.createDialogArea(parent);

   Browser browser = new Browser(composite, SWT.NONE);
   browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

   try {
      String html = new String(ResourceUtils.getBundleResourceBytes(CoreConstants.PLUGIN_UI, "resources/about.html"));
      html = html.replaceAll("currentYear", ""+Calendar.getInstance().get(Calendar.YEAR));
      browser.setText(html);

   } catch (Exception e) {
      setErrorMessage(e.getLocalizedMessage());
   }
   return composite;
}
 
Example 2
Source File: HtmlDialog.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
   Composite c = (Composite) super.createDialogArea(parent);
   b = new Browser(c, SWT.BORDER);
   GridData gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
   b.setLayoutData(gd);
   b.setText(html);
   b.setSize(500, 500);
   if (listener != null) {
      b.addLocationListener(listener);
   }
   b.setMenu(pageOverviewGetPopup());

   return c;
}
 
Example 3
Source File: TypeInformationPopup.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea(final Composite parent) {
	final Object layoutData = parent.getLayoutData();
	if (layoutData instanceof GridData) {
		((GridData) layoutData).heightHint = DEFAULT_SIZE.x;
		((GridData) layoutData).widthHint = DEFAULT_SIZE.y;
	}
	final Browser browser = new Browser(parent, NONE);
	browser.setText(html);
	return browser;
}
 
Example 4
Source File: EsbStartingBrowser.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
@Override
public void createPartControl(Composite parent) {
    try {
        browser = new Browser(parent, SWT.NONE);
        browser.setText(EsbStartingHelper.getHelper().getHtmlContent());
        browser.addLocationListener(new BrowserDynamicPartLocationListener());
    } catch (IOException e) {
        ExceptionHandler.process(e);
    } catch (Throwable t) {

        Exception ex = new Exception("The internal web browser can not be access,the starting page won't be displayed");
        ExceptionHandler.process(ex);
    }
}
 
Example 5
Source File: RocketchatPart.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create contents of the view part.
 */
@PostConstruct
public void createControls(Composite parent){
	
	browser = new Browser(parent, SWT.NONE);
	if (elexisEnvironmentService == null) {
		browser.setText("Elexis-Environment nicht konfiguriert");
	} else {
		//		browser.setCookie(value, url)
		// login cookies?!
		browser.setUrl(elexisEnvironmentService.getRocketchatBaseUrl());
	}
	
}
 
Example 6
Source File: BookstackPart.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create contents of the view part.
 */
@PostConstruct
public void createControls(Composite parent){
	browser = new Browser(parent, SWT.NONE);
	if (elexisEnvironmentService == null) {
		browser.setText("Elexis-Environment nicht konfiguriert");
	} else {
		//		browser.setCookie(value, url)
		// login cookies?!
		browser.setUrl(elexisEnvironmentService.getBookstackBaseUrl());
	}
}