当前位置: 首页>>代码示例>>Java>>正文


Java Browser.setText方法代码示例

本文整理汇总了Java中org.eclipse.swt.browser.Browser.setText方法的典型用法代码示例。如果您正苦于以下问题:Java Browser.setText方法的具体用法?Java Browser.setText怎么用?Java Browser.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.browser.Browser的用法示例。


在下文中一共展示了Browser.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPartControl

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
	browser = new Browser(parent, SWT.None);
	URL url;
	try {
		url = new URL("platform:/plugin/reFactor/resources/technical_debt.html");
		InputStream inputStream = url.openConnection().getInputStream();
		BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
		String inputLine = "";
		String html = "";
		while ((inputLine = in.readLine()) != null) {
			html += inputLine;
		}
		browser.setText(html);
		in.close();

	} catch (IOException e) {
		e.printStackTrace();
	}

	// try {
	// url = new URL("platform:/plugin/reFactor/resources/technical_debt.html");
	// } catch (IOException e) {
	// e.printStackTrace();
	// }
}
 
开发者ID:ioanaverebi,项目名称:Sparrow,代码行数:27,代码来源:TechnicalDebtView.java

示例2: createDialogArea

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
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;
}
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:17,代码来源:AboutDialog.java

示例3: createDialogArea

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);

    GridLayout layout = new GridLayout(1, false);
    composite.setLayout(layout);

    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    composite.setLayoutData(data);

    Browser browser = new Browser(composite, SWT.NONE);
    browser.setText(browserString);
    browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    
    if (Util.isMac())
        browser.refresh();
    
    composite.pack();

    return composite;
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:22,代码来源:VersionsDiffBrowserDialog.java

示例4: viewThreadStack

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
public void viewThreadStack( String filter ) {
    if ( filter == null )
        return;

    StackFileInfo stackFileInfo = getSelectedStackFileInfo();
    if ( stackFileInfo == null )
        return;

    String filename = StackParser.getWorkingThreadFilename(stackFileInfo.getFilename());
    int stackStartLine = stackFileInfo.getParserConfig().getStackStartLine();
    if ( filename != null && filter != null ) {
    	Browser broswer = getBrowser();
        if ( m_isExcludeStack )
        	broswer.setText(HtmlUtils.filterThreadStack(filename, filter, stackFileInfo.getParserConfig().getExcludeStack(), stackStartLine));
        else
        	broswer.setText(HtmlUtils.filterThreadStack(filename, filter, null, stackStartLine));
    }

}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:20,代码来源:MainProcessor.java

示例5: createFieldEditors

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/**
 *
 */
public void createFieldEditors() {
	NStringFieldEditor tf = new NStringFieldEditor(CsvExporterConfiguration.PROPERTY_RECORD_DELIMITER,
			Messages.CSVExporterPreferencePage_3, 4, getFieldEditorParent());
	tf.setEmptyStringAllowed(false);
	tf.setTextLimit(10);
	addField(tf);
	HelpSystem.setHelp(tf.getTextControl(getFieldEditorParent()),
			StudioPreferencePage.REFERENCE_PREFIX + tf.getPreferenceName());

	tf = new NStringFieldEditor(CsvExporterConfiguration.PROPERTY_FIELD_DELIMITER,
			Messages.CSVExporterPreferencePage_4, 4, getFieldEditorParent());
	tf.setEmptyStringAllowed(false);
	tf.setTextLimit(10);
	addField(tf);
	HelpSystem.setHelp(tf.getTextControl(getFieldEditorParent()),
			StudioPreferencePage.REFERENCE_PREFIX + tf.getPreferenceName());

	Browser lbl = BrowserUtils.getSWTBrowserWidget(getFieldEditorParent(), SWT.MULTI);
	lbl.setText(Messages.CSVExporterPreferencePage_5);

	GridData gd = new GridData(GridData.FILL_BOTH);
	gd.horizontalSpan = 2;
	lbl.setLayoutData(gd);

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:CSVExporterPreferencePage.java

示例6: setImageInBrowser

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/**
 * Set an image as browser content.
 * 
 * @param browser the browser to use.
 * @param imageId the id of the image to show.
 * @param imageName the name of the image to show.
 * @param dbFile the db to use.
 * @param IMAGE_KEY the image key.
 * @param SERVICE_HANDLER the service handler id.
 * @throws Exception
 */
public static void setImageInBrowser( Browser browser, long imageId, String imageName, File dbFile, String IMAGE_KEY,
        String SERVICE_HANDLER ) throws Exception {
    try (SqliteDb db = new SqliteDb()) {
        db.open(dbFile.getAbsolutePath());
        IJGTConnection connection = db.getConnection();
        byte[] imageData = DaoImages.getImageData(connection, imageId);
        InputStream imageStream = null;
        try {
            imageStream = new ByteArrayInputStream(imageData);
            BufferedImage bufferedImage = createImage(imageStream);
            // store the image in the UISession for the service handler
            RWT.getUISession().setAttribute(IMAGE_KEY, bufferedImage);
            // create the HTML with a single <img> tag.
            browser.setText(createHtml(IMAGE_KEY, SERVICE_HANDLER));
            // newImageFile.delete();
        } catch (Exception e) {
            // File newImageFile = File.createTempFile("stage" + new Date().getTime(),
            // imageName);
            // try (OutputStream outStream = new FileOutputStream(newImageFile)) {
            // outStream.write(imageData);
            // }
            e.printStackTrace();
        }
    }
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:37,代码来源:GeopaparazziUtilities.java

示例7: main

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
public static void main(String[] args) {
	if (InitializationManager.lock())
		System.exit(1);
	System.setProperty("data.dir", Constants.APPLICATION_DIR.getAbsolutePath());
	InitializationManager.start(new BasicConfigurator());
	/* Relative links: use the HTML base tag */
	String html = "<html><head>" + "<base href=\"http://127.0.0.1:8080/\" >" + "<title>HTML AutowiredConfigurationTests</title>"
			+ " <link rel=\"stylesheet\" type=\"text/css\" href=\"sites/s-th.info/format.css\" /></head>"
			+ "<body><a href=\"changelog\">local link</a></body></html>";

	Display display = new Display();
	Shell shell = new Shell(display);
	shell.setLayout(new FillLayout());
	Browser browser = new Browser(shell, SWT.NONE);
	browser.setText(html);
	shell.open();
	System.out.println(html);
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
	display.dispose();

	ThreadController.getInstance().stopAllThreads();
	InitializationManager.end();
}
 
开发者ID:th-schwarz,项目名称:pmcms,代码行数:27,代码来源:HTMLRenderRelativeMemory.java

示例8: createToolTipContentArea

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
protected Composite createToolTipContentArea(Event event,
		Composite parent) {
	Composite comp = new Composite(parent, SWT.NONE);
	GridLayout l = new GridLayout(1, false);
	l.horizontalSpacing = 0;
	l.marginWidth = 0;
	l.marginHeight = 0;
	l.verticalSpacing = 0;

	comp.setLayout(l);
	Browser browser = new Browser(comp, SWT.BORDER);
	browser.setText(getText(event));
	browser.setLayoutData(new GridData(200, 150));

	return comp;
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:17,代码来源:TreeWithTooltipSupport.java

示例9: createDialogArea

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@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;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:TypeInformationPopup.java

示例10: createPartControl

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	FillLayout layout = new FillLayout();
	composite.setLayout(layout);
	browser = new Browser(composite, SWT.NONE);
	browser.setText(htmlText);
	menu = new Menu(browser);
	addMenuItems(menu);
	menu.setVisible(false);
	browser.setMenu(menu);
}
 
开发者ID:turnus,项目名称:turnus,代码行数:13,代码来源:AbstractBrowserEditor.java

示例11: initUi

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public Composite initUi(final Composite parent) {
	final Composite content = toolkit.createComposite(parent);
	final GridLayout layout = new GridLayout(1, false);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	content.setLayout(layout);

	browser = new Browser(content, SWT.NONE);
	browser.setLayoutData(new GridData(GridData.FILL_BOTH));
	browser.setText(readPage());

	btnShow = toolkit.createButton(content, "Diese Ansicht beim Start anzeigen", SWT.CHECK);
	setCheckBoxt();
	btnShow.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(final SelectionEvent e) {
			try {
				ServiceLocator.getInstance().getCuratorService()
						.toggleWelcome(SessionHolder.getInstance().getCurator().getId());
				setCheckBoxt();
			} catch (final ConnectException exception) {
				handle(exception);
			}
		}
	});
	return content;
}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:30,代码来源:WelcomeView.java

示例12: createDialogArea

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
protected Control createDialogArea(Composite parent) {
	Composite comp =  (Composite) super.createDialogArea(parent);
	FillLayout fillLayout = new FillLayout();
	fillLayout.marginWidth = 5;
	fillLayout.marginHeight = 5;
	comp.setLayout(fillLayout);
	Browser webview = new Browser(comp, SWT.BORDER);
	webview.setText(message);
	return webview;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:11,代码来源:NoticeDialog.java

示例13: displayContent

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
public void displayContent( String textHtml ) {
	Browser browser = getBrowser();
    if ( textHtml != null ) {
    	browser.setText(textHtml);
    } else {
    	browser.setText(HtmlUtils.getDefaultBody());
    }
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:9,代码来源:MainProcessor.java

示例14: createFieldEditors

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
/**
 *
 */
public void createFieldEditors() {
	NStringFieldEditor tf = new NStringFieldEditor(CsvExporterConfiguration.PROPERTY_RECORD_DELIMITER,
			Messages.CSVExporterPreferencePage_3, 4, getFieldEditorParent());
	tf.setEmptyStringAllowed(false);
	tf.setTextLimit(10);
	addField(tf);
	HelpSystem.setHelp(tf.getTextControl(getFieldEditorParent()),
			StudioPreferencePage.REFERENCE_PREFIX + tf.getPreferenceName());

	tf = new NStringFieldEditor(CsvExporterConfiguration.PROPERTY_FIELD_DELIMITER,
			Messages.CSVExporterPreferencePage_4, 4, getFieldEditorParent());
	tf.setEmptyStringAllowed(false);
	tf.setTextLimit(10);
	addField(tf);
	HelpSystem.setHelp(tf.getTextControl(getFieldEditorParent()),
			StudioPreferencePage.REFERENCE_PREFIX + tf.getPreferenceName());

	Browser browser = BrowserUtils.getSWTBrowserWidget(getFieldEditorParent(), SWT.MULTI);
	browser.setText(Messages.CSVExporterPreferencePage_5);

	GridData gd = new GridData(GridData.FILL_BOTH);
	gd.horizontalSpan = 2;
	browser.setLayoutData(gd);

	BooleanFieldEditor bf = new BooleanFieldEditor(CsvMetadataReportConfiguration.PROPERTY_WRITE_HEADER,
			Messages.CSVMetadataExporterPreferencePage_writeHeaders, getFieldEditorParent());
	addField(bf);
	HelpSystem.setHelp(bf.getDescriptionControl(getFieldEditorParent()),
			StudioPreferencePage.REFERENCE_PREFIX + bf.getPreferenceName());

	tf = new NStringFieldEditor(CsvMetadataReportConfiguration.PROPERTY_COLUMN_NAMES_PREFIX,
			Messages.CSVMetadataExporterPreferencePage_columnNames, getFieldEditorParent());
	addField(tf);
	HelpSystem.setHelp(tf.getTextControl(getFieldEditorParent()),
			StudioPreferencePage.REFERENCE_PREFIX + tf.getPreferenceName() + ".{suffix}"); //$NON-NLS-1$
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:40,代码来源:CSVMetadataExporterPreferencePage.java

示例15: createPartControl

import org.eclipse.swt.browser.Browser; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
  browser = new Browser(parent, SWT.NONE);
  browser.setText(INITIAL_HTML);
  updateContent();
  hookPageSelection();
}
 
开发者ID:fmoraes74,项目名称:eclipseforces,代码行数:8,代码来源:ProblemStatementView.java


注:本文中的org.eclipse.swt.browser.Browser.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。