use of org.eclipse.swt.layout.FormData in project tdi-studio-se by Talend.
the class RuntimeGraphcsComposite method reconstructCharts.
void reconstructCharts(IActiveJvm activeJvm, boolean connected) {
if (chartsPage.isDisposed()) {
return;
}
if (connected) {
try {
loadOverviewChartSet(activeJvm);
} catch (JvmCoreException e) {
Activator.log(Messages.configureMonitoredAttributesFailedMsg, e);
}
}
List<IMonitoredMXBeanGroup> groups = activeJvm.getMBeanServer().getMonitoredAttributeGroups();
if (groups.size() == 0) {
return;
}
for (TimelineChart chart : charts) {
chart.dispose();
}
charts.clear();
if (chartComposite != null && !chartComposite.isDisposed()) {
chartComposite.dispose();
}
chartComposite = new Composite(chartsPage, SWT.NONE);
FormLayout chartLayout = new FormLayout();
chartLayout.marginHeight = 0;
chartLayout.marginWidth = 0;
chartComposite.setLayout(chartLayout);
FormData chartComData = new FormData();
chartComData.top = new FormAttachment(0, 0);
chartComData.bottom = new FormAttachment(100, 0);
chartComData.left = new FormAttachment(0, 0);
chartComData.right = new FormAttachment(100, 0);
chartComposite.setLayoutData(chartComData);
for (IMonitoredMXBeanGroup group : groups) {
createSection(chartComposite, group);
}
createReportField(chartComposite);
// createInfoField(chartComposite);
chartsPage.layout();
chartsPage.setVisible(true);
refresh();
}
use of org.eclipse.swt.layout.FormData in project tdi-studio-se by Talend.
the class RuntimeGraphcsComposite method createSection.
private void createSection(Composite parent, IMonitoredMXBeanGroup group) {
if (parent.isDisposed()) {
return;
}
FormToolkit tookit = new FormToolkit(Display.getDefault());
ExpandableComposite section = tookit.createSection(parent, ExpandableComposite.NO_TITLE);
section.setText(group.getName());
FormLayout sectionLayout = new FormLayout();
sectionLayout.marginWidth = 0;
sectionLayout.marginHeight = 0;
section.setLayout(sectionLayout);
FormData sectionData = new FormData();
if (group.getName().equals(MonitorAttributeName.HEAP_MEMORY)) {
sectionData.left = new FormAttachment(0, 0);
sectionData.right = new FormAttachment(65, 0);
sectionData.top = new FormAttachment(0, 6);
sectionData.bottom = new FormAttachment(53, -5);
} else if (group.getName().equals(MonitorAttributeName.THREAD_COUNT)) {
sectionData.left = new FormAttachment(50, 5);
sectionData.right = new FormAttachment(100, -5);
sectionData.top = new FormAttachment(50, 2);
sectionData.bottom = new FormAttachment(100, 0);
} else if (group.getName().equals(MonitorAttributeName.CPU_USE)) {
sectionData.left = new FormAttachment(0, 0);
sectionData.right = new FormAttachment(65, 0);
sectionData.top = new FormAttachment(53, 0);
sectionData.bottom = new FormAttachment(100, -6);
}
section.setLayoutData(sectionData);
Composite flatFormComposite = createFlatFormComposite(section, tookit);
FormLayout formLayout = new FormLayout();
formLayout.marginHeight = 0;
formLayout.marginWidth = 0;
flatFormComposite.setLayout(formLayout);
TimelineChart chart = new TimelineChart(flatFormComposite, section, group, SWT.NONE, toString() + getJvm().getPid());
charts.add(chart);
FormData data;
data = new FormData();
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
data.top = new FormAttachment(0, 0);
data.bottom = new FormAttachment(100, 0);
chart.setLayoutData(data);
section.setClient(flatFormComposite);
ArrayList<Action> list = new ArrayList<Action>();
list.add(garbageCollectorAction);
if (group.getName().equals(MonitorAttributeName.HEAP_MEMORY)) {
addSectionActions(section, list);
}
}
use of org.eclipse.swt.layout.FormData in project tdi-studio-se by Talend.
the class TimelineSection method createSection.
/**
* Creates the section.
*
* @param parent The parent composite
* @param group The attribute group
*/
private void createSection(Composite parent, IMonitoredMXBeanGroup group) {
if (parent.isDisposed()) {
return;
}
ExpandableComposite section = getWidgetFactory().createSection(parent, ExpandableComposite.TITLE_BAR);
section.setText(group.getName());
section.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite flatFormComposite = getWidgetFactory().createFlatFormComposite(section);
FormLayout formLayout = new FormLayout();
formLayout.marginHeight = 0;
formLayout.marginWidth = 0;
flatFormComposite.setLayout(formLayout);
TimelineChart chart = new TimelineChart(flatFormComposite, section, group, SWT.NONE, toString() + getJvm().getPid());
charts.add(chart);
FormData data;
data = new FormData();
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
data.top = new FormAttachment(0, 0);
data.bottom = new FormAttachment(100, 0);
chart.setLayoutData(data);
section.setClient(flatFormComposite);
List<Action> actions = new ArrayList<Action>();
for (IMonitoredMXBeanAttribute attribute : group.getAttributes()) {
if (attribute.getAttributeName().startsWith("HeapMemoryUsage")) {
//$NON-NLS-1$
actions.add(garbageCollectorAction);
break;
}
}
actions.add(new ConfigureChartAction(chart, this));
addSectionActions(section, actions);
}
use of org.eclipse.swt.layout.FormData in project tdi-studio-se by Talend.
the class AbstractRuntimeGraphcsComposite method initGraphcs.
private void initGraphcs() {
// messagePage = createMessagePage(parent);
contentPage = new Composite(this, SWT.NULL);
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = 0;
formLayout.marginHeight = 0;
contentPage.setLayout(formLayout);
FormData pageData = new FormData();
pageData.top = new FormAttachment(0, 0);
pageData.bottom = new FormAttachment(100, 0);
pageData.left = new FormAttachment(0, 0);
pageData.right = new FormAttachment(100, 0);
contentPage.setLayoutData(pageData);
createControls(contentPage);
contentPage.layout();
contentPage.setVisible(true);
JvmModel.getInstance().addJvmModelChangeListener(this);
suspendRefresh = false;
}
use of org.eclipse.swt.layout.FormData 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);
}
}
Aggregations