public void fill(Composite parent) { super.fill(parent); Composite container = new Composite(parent, SWT.NONE); GridLayout gl = new GridLayout(2, false); gl.marginWidth = 5; gl.marginHeight = 3; container.setLayout(gl); progressBar = new ProgressBar(container, SWT.SMOOTH); GridData gdPprogressBar = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gdPprogressBar.heightHint = 16; gdPprogressBar.widthHint = 130; progressBar.setLayoutData(gdPprogressBar); progressBar.setMinimum(0); // 最小值 progressBar.setMaximum(100);// 最大值 progressBar.setSelection(progressValue); progressBar.setToolTipText(defaultMessage); label = new Label(container, SWT.None); label.setText(progressValue + "%"); StatusLineLayoutData data = new StatusLineLayoutData(); container.setLayoutData(data); }
@Override protected Control createControl(final Composite parent) { createListeners(); mapPane.addMapPaneListener(mapPaneListener); mapPane.getMapContent().addMapBoundsListener(this); final Composite mainComposite = new Composite(parent, SWT.NONE); final GridLayout gridLayout = new GridLayout(1, false); mainComposite.setLayout(gridLayout); final StatusLineLayoutData statusLineLayoutData = new StatusLineLayoutData(); // statusLineLayoutData.widthHint = 500; mainComposite.setLayoutData(statusLineLayoutData); crsButton = new Button(mainComposite, SWT.PUSH); final GridData crsButtonGD = new GridData(SWT.BEGINNING, SWT.CENTER, false, false); crsButtonGD.widthHint = 300; crsButton.setLayoutData(crsButtonGD); final CoordinateReferenceSystem crs = getCrs(); displayCRS(crs); crsButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { final CRSChooserDialog dialog = new CRSChooserDialog(crsButton.getShell(), getCrs()); dialog.setBlockOnOpen(true); dialog.open(); final CoordinateReferenceSystem newCrs = dialog.getResult(); mapPane.setCrs(newCrs); mapPane.redraw(); displayCRS(newCrs); } }); return mainComposite; }
public void fill(Composite parent) { super.fill(parent); Composite container = new Composite(parent, SWT.NONE); GridLayout gl = new GridLayout(1, false); gl.marginWidth = 0; gl.marginHeight = 0; gl.marginTop = 0; gl.marginRight = 0; gl.marginBottom = 0; container.setLayout(gl); // progressBar = new ProgressBar(container, SWT.SMOOTH); // GridData gdPprogressBar = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); // gdPprogressBar.heightHint = 16; // gdPprogressBar.widthHint = 130; // progressBar.setLayoutData(gdPprogressBar); // progressBar.setMinimum(0); // 最小值 // progressBar.setMaximum(100);// 最大值 // progressBar.setSelection(progressValue); // progressBar.setToolTipText(defaultMessage); GC gc = new GC(statusLine); int widthHint = gc.textExtent("100%").x; // int height = gc.textExtent("100%").y; gc.dispose(); label = new Label(container, SWT.NONE); GridData gd = new GridData(SWT.LEFT, SWT.CENTER, false, true, 1, 1); gd.widthHint = widthHint; label.setLayoutData(gd); label.setText(progressValue + "%"); StatusLineLayoutData data = new StatusLineLayoutData(); container.setLayoutData(data); }
@Override public void fill(Composite parent) { /* // Label separator = new Label(parent, SWT.SEPARATOR); CLabel label = new CLabel(parent, SWT.NONE); GridLayout layout = new GridLayout(1, Boolean.FALSE); layout.horizontalSpacing = 20; parent.setLayout(layout); // StatusLineLayoutData statusLineLayoutData = new StatusLineLayoutData(); // label.setLayoutData(statusLineLayoutData); label.setLayout(new GridLayout(1, Boolean.FALSE)); label.setData(new GridData(30, 30)); label.setText(text); label.setImage(image); // Composite composite = toolkit.createComposite(parent); // parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE)); */ StatusLineLayoutData statusLineLayoutData = new StatusLineLayoutData(); parent.setLayoutData(statusLineLayoutData); new Label(parent, SWT.SEPARATOR); CLabel title = new CLabel(parent, SWT.NONE); title.setText("2013 Alm-iStack Collaborative Tool Software"); title.setImage(ImageProvider.IMG_COPYRIGHT); new Label(parent, SWT.SEPARATOR); CLabel about = new CLabel(parent, SWT.NONE); about.setText("About"); new Label(parent, SWT.SEPARATOR); CLabel recycleBin = new CLabel(parent, SWT.NONE); recycleBin.setText("Recycle Bin"); recycleBin.setImage(ImageProvider.IMG_BIN_EMTY); }