use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class BrowserViewPart method createBrowserArea.
private Composite createBrowserArea(Composite parent) {
GridLayout gridLayout = new GridLayout(1, false);
parent.setLayout(gridLayout);
GridData gd_displayArea = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
parent.setLayoutData(gd_displayArea);
tabFolder = new CTabFolder(parent, SWT.TOP | SWT.MULTI | SWT.FLAT);
tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
UIJob job = new UIJob(Display.getDefault(), "refresh browser") {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
refreshTabContent();
return Status.OK_STATUS;
}
/** (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#shouldRun()
*/
@Override
public boolean shouldRun() {
return !tabFolder.isDisposed();
}
};
job.schedule();
return parent;
}
use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class BrowserViewPart method createSearchArea.
private Composite createSearchArea(Composite parent) {
GridLayout gridLayout = new GridLayout(3, false);
parent.setLayout(gridLayout);
GridData gd_seachArea = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
parent.setLayoutData(gd_seachArea);
keyWordForSearch = new Text(parent, SWT.SEARCH);
GridData gd_keyWordForSearch = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
gd_keyWordForSearch.heightHint = 20;
keyWordForSearch.setLayoutData(gd_keyWordForSearch);
keyWordForSearch.setText("");
font = keyWordForSearch.getFont();
FontData fontData = font.getFontData()[0];
fontData.setStyle(fontData.getStyle());
fontData.setHeight(12);
font = new Font(Display.getDefault(), fontData);
keyWordForSearch.setFont(font);
keyWordForSearch.addKeyListener(new KeyListener() {
@Override
public void keyReleased(KeyEvent e) {
// TODO Auto-generated method stub
}
@Override
public void keyPressed(KeyEvent e) {
// TODO Auto-generated method stub
if (e.keyCode == SWT.CR || e.keyCode == SWT.LF) {
refreshKeyWordSearch(true);
}
}
});
Button searchBtn = new Button(parent, SWT.NONE);
searchBtn.setText(Messages.getString("Websearch.browserViewPart.searchBtnLbl"));
searchBtn.setLayoutData(new GridData(GridData.FILL_VERTICAL));
searchBtn.addSelectionListener(new SelectionAdapter() {
/**
* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
refreshKeyWordSearch(true);
}
});
Button settingBtn = new Button(parent, SWT.NONE);
settingBtn.setText(Messages.getString("Websearch.browserViewPart.settingBtnLbl"));
settingBtn.setLayoutData(new GridData(GridData.FILL_VERTICAL));
settingBtn.addSelectionListener(new SelectionAdapter() {
/**
* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
PreferenceUtil.openPreferenceDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), WebSearchPreferencePage.ID);
}
});
return parent;
}
use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class AddSearchEntryDialog method createDialogArea.
/**
* Create contents of the dialog.
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new GridLayout(1, false));
GridData gridData = new GridData(GridData.FILL_BOTH);
gridData.heightHint = SWT.DEFAULT;
gridData.widthHint = 450;
container.setLayoutData(gridData);
Composite nameSetArea = new Composite(container, SWT.NONE);
GridLayout gridLayout = new GridLayout(2, false);
nameSetArea.setLayout(gridLayout);
nameSetArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label nameLable = new Label(nameSetArea, SWT.NONE);
GridData gd_nameLable = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_nameLable.widthHint = 38;
nameLable.setLayoutData(gd_nameLable);
nameLable.setText(Messages.getString("Websearch.AddSearchEntryDialog.NameLable"));
nameText = new Text(nameSetArea, SWT.BORDER);
nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
if (style == EDIT) {
nameText.setText(searEntry.getSearchName());
}
nameText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
setOkState();
}
});
Composite urlSetArea = new Composite(container, SWT.NONE);
GridLayout gridLayout2 = new GridLayout(2, false);
urlSetArea.setLayout(gridLayout2);
urlSetArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label urlLable = new Label(urlSetArea, SWT.NONE);
GridData gd_urlLable = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_urlLable.widthHint = 38;
urlLable.setLayoutData(gd_urlLable);
urlLable.setText("URL");
urlText = new Text(urlSetArea, SWT.BORDER);
if (style == EDIT) {
urlText.setText(searEntry.getSearchUrl());
}
urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
urlText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
setOkState();
}
});
Composite setArea = new Composite(container, SWT.NONE);
setArea.setLayout(new GridLayout(1, true));
setArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Group group = new Group(setArea, SWT.NONE);
group.setLayout(new GridLayout(2, true));
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
group.setText(Messages.getString("Websearch.AddSearchEntryDialog.GroupTitle"));
btnYesRadioButton = new Button(group, SWT.RADIO);
btnYesRadioButton.setText(Messages.getString("Websearch.AddSearchEntryDialog.GroupYes"));
btnYesRadioButton.setSelection(true);
btnYesRadioButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
btnNoRadioButton = new Button(group, SWT.RADIO);
btnNoRadioButton.setText(Messages.getString("Websearch.AddSearchEntryDialog.GroupNo"));
btnNoRadioButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
if (style == EDIT) {
btnYesRadioButton.setSelection(searEntry.isChecked());
btnNoRadioButton.setSelection(!searEntry.isChecked());
}
return container;
}
use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class WebSearchPreferencePage method createTableCmdArea.
private Composite createTableCmdArea(Composite parent) {
Composite urlCmdArea = new Composite(parent, SWT.NONE);
GridLayout urlCmdArea_layout = new GridLayout(1, true);
urlCmdArea.setLayout(urlCmdArea_layout);
urlCmdArea.setLayoutData(new GridData(GridData.FILL_VERTICAL));
addItemBtn = new Button(urlCmdArea, SWT.NONE);
addItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.Add"));
editItemBtn = new Button(urlCmdArea, SWT.NONE);
editItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.edit"));
editItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
editItemBtn.setEnabled(false);
deleteItemBtn = new Button(urlCmdArea, SWT.NONE);
deleteItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.delete"));
deleteItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
deleteItemBtn.setEnabled(false);
upItemBtn = new Button(urlCmdArea, SWT.NONE);
upItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
upItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.upitem"));
upItemBtn.setEnabled(false);
downItemBtn = new Button(urlCmdArea, SWT.NONE);
downItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
downItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.downitem"));
downItemBtn.setEnabled(false);
importItemsBtn = new Button(urlCmdArea, SWT.NONE);
importItemsBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
importItemsBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.import"));
exportItemsBtn = new Button(urlCmdArea, SWT.NONE);
exportItemsBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
exportItemsBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.export"));
return urlCmdArea;
}
use of org.eclipse.swt.layout.GridData in project translationstudio8 by heartsome.
the class LicenseAgreementDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite tparent = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginTop = 5;
layout.marginWidth = 10;
tparent.setLayout(layout);
GridData parentData = new GridData(SWT.FILL, SWT.FILL, true, true);
parentData.heightHint = 380;
tparent.setLayoutData(parentData);
Label lbl = new Label(tparent, SWT.NONE);
lbl.setText(Messages.getString("license.LicenseAgreementDialog.label"));
lbl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Text text = new Text(tparent, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
text.setEditable(false);
text.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
text.setText(Messages.getString("license.LicenseAgreementDialog.agreement"));
GridData textData = new GridData(GridData.FILL_BOTH);
text.setLayoutData(textData);
agreeBtn = new Button(tparent, SWT.CHECK);
agreeBtn.setText(Messages.getString("license.LicenseAgreementDialog.agreeBtn"));
agreeBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
agreeBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
getButton(IDialogConstants.OK_ID).setEnabled(agreeBtn.getSelection());
}
});
return super.createDialogArea(parent);
}
Aggregations