use of org.eclipse.swt.browser.Browser in project tdi-studio-se by Talend.
the class ImportDemoProjectItemsPage method createDescriptionIn.
/**
* DOC Administrator Comment method "createDescriptionIn".
*
* @param composite
*/
public void createDescriptionIn(Composite composite) {
if (TalendPropertiesUtil.isEnabledUseBrowser()) {
descriptionBrowser = new Browser(composite, SWT.BORDER);
//$NON-NLS-1$
descriptionBrowser.setText("");
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = 200;
descriptionBrowser.setLayoutData(gd);
} else {
descriptionText = new Text(composite, SWT.BORDER | SWT.WRAP);
//$NON-NLS-1$
descriptionText.setText("");
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = 200;
descriptionText.setLayoutData(gd);
}
}
use of org.eclipse.swt.browser.Browser in project tdi-studio-se by Talend.
the class ImportDemoProjectPage method createDescriptionIn.
/**
* DOC Administrator Comment method "createDescriptionIn".
*
* @param composite
*/
public void createDescriptionIn(Composite composite) {
if (TalendPropertiesUtil.isEnabledUseBrowser()) {
descriptionBrowser = new Browser(composite, SWT.BORDER);
//$NON-NLS-1$
descriptionBrowser.setText("");
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = 200;
descriptionBrowser.setLayoutData(gd);
} else {
descriptionText = new Text(composite, SWT.BORDER | SWT.WRAP);
//$NON-NLS-1$
descriptionText.setText("");
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = 200;
descriptionText.setLayoutData(gd);
}
}
use of org.eclipse.swt.browser.Browser in project tdi-studio-se by Talend.
the class LoginAgreementPage method createControl.
@Override
public void createControl(Composite parentCtrl) {
Composite container = new Composite(parentCtrl, SWT.NONE);
container.setLayout(new FormLayout());
Label titleLabel = new Label(container, SWT.WRAP);
titleLabel.setFont(LoginDialogV2.fixedFont);
//$NON-NLS-1$
titleLabel.setText(Messages.getString("LoginAgreementPage.title"));
FormData titleLabelFormData = new FormData();
titleLabelFormData.left = new FormAttachment(0, 0);
titleLabelFormData.top = new FormAttachment(0, 0);
titleLabel.setLayoutData(titleLabelFormData);
acceptButton = new Button(container, SWT.CENTER);
acceptButton.setBackground(backgroundColor);
acceptButton.setFont(LoginDialogV2.fixedFont);
//$NON-NLS-1$
acceptButton.setText(Messages.getString("LoginAgreementPage.accept"));
FormData acceptButtonFormLayoutData = new FormData();
acceptButtonFormLayoutData.bottom = new FormAttachment(100, 0);
acceptButtonFormLayoutData.right = new FormAttachment(100, 0);
acceptButtonFormLayoutData.left = new FormAttachment(100, -1 * LoginDialogV2.getNewButtonSize(acceptButton).x);
acceptButton.setLayoutData(acceptButtonFormLayoutData);
boolean haveHtmlDesc = false;
FileInputStream licenseInputStream = null;
String licenseFileBasePath = Platform.getInstallLocation().getURL().getPath();
if (Boolean.parseBoolean(System.getProperty("USE_BROWSER"))) {
//$NON-NLS-1$
File htmlFile = new File(licenseFileBasePath + LICENSE_FILE_PATH_HTML);
if (htmlFile.exists()) {
try {
licenseInputStream = new FileInputStream(htmlFile);
if (licenseInputStream != null) {
haveHtmlDesc = true;
}
} catch (FileNotFoundException e) {
CommonExceptionHandler.process(e);
}
}
}
if (licenseInputStream == null) {
try {
licenseInputStream = new FileInputStream(licenseFileBasePath + LICENSE_FILE_PATH);
} catch (FileNotFoundException e) {
CommonExceptionHandler.process(e);
}
}
FormData clufLayoutData = new FormData();
clufLayoutData.top = new FormAttachment(titleLabel, LoginDialogV2.TAB_VERTICAL_PADDING_LEVEL_1, SWT.BOTTOM);
clufLayoutData.left = new FormAttachment(0, 0);
clufLayoutData.right = new FormAttachment(100, 0);
clufLayoutData.bottom = new FormAttachment(acceptButton, -1 * LoginDialogV2.TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
if (haveHtmlDesc) {
clufBrowser = new Browser(container, SWT.BORDER);
clufBrowser.setText(getLicense(licenseInputStream));
clufBrowser.setLayoutData(clufLayoutData);
} else {
clufText = new Text(container, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL | SWT.LEFT | SWT.BORDER);
clufText.setBackground(new Color(null, 255, 255, 255));
//$NON-NLS-1$
Font font = new Font(DisplayUtils.getDisplay(), "courier", 10, SWT.NONE);
clufText.setFont(font);
clufText.setEditable(false);
clufText.setText(getLicense(licenseInputStream));
clufText.setLayoutData(clufLayoutData);
}
}
use of org.eclipse.swt.browser.Browser in project tdi-studio-se by Talend.
the class ExchangeView method createPartControl.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
try {
browser = new Browser(parent, SWT.NONE);
manager.setBrowser(browser);
browser.addLocationListener(new MyExtensionLocationListener());
browser.setLayoutData(new GridData(GridData.FILL_BOTH));
if (manager.getDocument() != null) {
RefreshComponenentsAction action = new RefreshComponenentsAction();
action.run(new String[] { RefreshComponenentsAction.REFRESH_ALL });
}
} catch (Throwable t) {
Exception ex = new Exception("The internal web browser can not be access,the exchange view won't be displayed");
ExceptionHandler.process(ex);
}
}
use of org.eclipse.swt.browser.Browser in project cubrid-manager by CUBRID.
the class BrowserEditorPart method initBrowser.
private void initBrowser(Composite parent) {
browser = new Browser(parent, SWT.None);
browser.setLayoutData(createGridData(FILL_BOTH, 3, 1, -1, -1));
// Add location change listener
browser.addLocationListener(new LocationListener() {
public void changing(LocationEvent e) {
location.setText(e.location);
}
public void changed(LocationEvent e) {
noOp();
}
});
// Add loading listener
browser.addProgressListener(new ProgressListener() {
// Set stopItem and progress bar status
public void changed(ProgressEvent e) {
if (!stopItem.isEnabled() && e.total != e.current) {
stopItem.setEnabled(true);
}
}
// Set stopItem,backItem,forwardItem and progress bar status
public void completed(ProgressEvent e) {
stopItem.setEnabled(false);
backItem.setEnabled(browser.isBackEnabled());
forwardItem.setEnabled(browser.isForwardEnabled());
}
});
}
Aggregations