List of usage examples for org.eclipse.jface.dialogs Dialog applyDialogFont
public static void applyDialogFont(Control control)
From source file:es.uah.aut.srg.micobs.mesp.ui.wizards.NewRepositoryFolderLocationPage.java
License:Open Source License
@Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); initializeDialogUnits(parent);//from ww w. ja v a 2 s . c o m GridLayout layout = new GridLayout(); layout.verticalSpacing = 0; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); createModelParameters(composite); createRepositorySelectionGroup(composite); setPageComplete(validatePage()); setErrorMessage(null); setMessage(null); setControl(composite); Dialog.applyDialogFont(composite); }
From source file:es.uah.aut.srg.micobs.ui.wizards.MICOBSProjectCreationPage.java
License:Open Source License
@Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); initializeDialogUnits(parent);// w ww . j av a 2 s .co m GridLayout layout = new GridLayout(); layout.verticalSpacing = 0; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); createModelParameters(composite); createLine(composite, 1); createPackageSelection(composite); createLine(composite, 1); if (canSelectLanguage() == true) { createLanguageSelection(composite); createLine(composite, 1); } createExtraParameters(composite); createFolderSelectionOption(composite); createLine(composite, 1); stackComposite = new Composite(composite, SWT.NONE); stackComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); stackCompositeLayout = new StackLayout(); stackComposite.setLayout(stackCompositeLayout); folderSelectionComposite = new Composite(stackComposite, SWT.NONE); folderSelectionComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); folderSelectionComposite.setLayout(new GridLayout(3, false)); Label location = new Label(folderSelectionComposite, SWT.NONE); location.setText("Location:"); folderSelectionText = new Text(folderSelectionComposite, SWT.BORDER); folderSelectionText.setEditable(false); folderSelectionText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); if (rootFolder != null) { folderSelectionText.setText(rootFolder.getFullPath().toOSString()); } folderSelectionButton = new Button(folderSelectionComposite, SWT.PUSH | SWT.RIGHT); folderSelectionButton.setText("Select Folder"); folderSelectionButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { handleFolderSelectionButtonPressed(); } }); folderSelectionComposite.setVisible(false); useExistingProject = false; locationComposite = new Composite(stackComposite, SWT.NONE); locationComposite.setLayout(new GridLayout()); locationComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); locationArea = new ProjectContentsLocationArea(getErrorReporter(), locationComposite); setButtonLayoutData(locationArea.getBrowseButton()); stackCompositeLayout.topControl = locationComposite; setPageComplete(validatePage()); setErrorMessage(null); setMessage(null); setControl(composite); Dialog.applyDialogFont(composite); }
From source file:es.uah.aut.srg.micobs.ui.wizards.MICOBSResourceCreationPage.java
License:Open Source License
@Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); initializeDialogUnits(parent);/*from ww w.j a va 2s .c o m*/ GridLayout layout = new GridLayout(); layout.verticalSpacing = 0; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); createModelParameters(composite); createExtraParameters(composite); createLine(composite, 1); createPackageSelection(composite); createLine(composite, 1); if (canSelectLanguage() == true) { createLanguageSelection(composite); createLine(composite, 1); } folderSelectionComposite = new Composite(composite, SWT.NONE); folderSelectionComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); folderSelectionComposite.setLayout(new GridLayout(3, false)); Label location = new Label(folderSelectionComposite, SWT.NONE); location.setText("Location:"); folderSelectionText = new Text(folderSelectionComposite, SWT.BORDER); folderSelectionText.setEditable(false); folderSelectionText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); folderSelectionButton = new Button(folderSelectionComposite, SWT.PUSH | SWT.RIGHT); folderSelectionButton.setText("Select Folder"); folderSelectionButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { handleFolderSelectionButtonPressed(); } }); setPageComplete(validatePage()); setErrorMessage(null); setMessage(null); setControl(composite); Dialog.applyDialogFont(composite); }
From source file:eu.esdihumboldt.hale.ui.util.dialog.StackTraceErrorDialog.java
License:Open Source License
private Link createShowErrorLogLink(Composite parent) { Link link = new Link(parent, SWT.NONE); link.addSelectionListener(new SelectionAdapter() { @Override//w w w.j a v a 2 s .c om public void widgetSelected(SelectionEvent e) { try { Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().showView(LOG_VIEW_ID); } catch (CoreException ce) { StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH); } } }); link.setText(WorkbenchMessages.ErrorLogUtil_ShowErrorLogHyperlink); link.setToolTipText(WorkbenchMessages.ErrorLogUtil_ShowErrorLogTooltip); Dialog.applyDialogFont(link); return link; }
From source file:eu.esdihumboldt.hale.ui.util.wizard.ViewerWizardSelectionPage.java
License:Open Source License
/** * @see IDialogPage#createControl(Composite) *//* w w w . j ava 2 s .co m*/ @Override public void createControl(Composite parent) { Font font = parent.getFont(); // create composite for page. Composite outerContainer = new Composite(parent, SWT.NONE); outerContainer.setLayout(new GridLayout()); outerContainer.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); outerContainer.setFont(font); Pair<StructuredViewer, Control> viewerControl = createViewer(outerContainer); viewer = viewerControl.getFirst(); viewerControl.getSecond().setLayoutData( GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, getViewerHeightHint()).create()); // wire viewer viewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { viewerSelectionChanged(event.getSelection()); } }); viewer.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { doubleClicked(event); } }); Dialog.applyDialogFont(outerContainer); // apply the initial selection viewerSelectionChanged(viewer.getSelection()); setControl(outerContainer); }
From source file:eu.geclipse.batch.ui.dialogs.AllowedVOsDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridData gd = new GridData(GridData.FILL_BOTH); container.setLayout(new GridLayout(3, false)); container.setLayoutData(gd);/*from w ww.j a v a 2s. co m*/ this.panel = new Composite(container, SWT.NONE); GridLayout layout = new GridLayout(3, false); this.panel.setLayout(layout); gd = new GridData(GridData.FILL_HORIZONTAL); this.panel.setLayoutData(gd); gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; GridData gData = new GridData(GridData.FILL_HORIZONTAL); gData.grabExcessHorizontalSpace = true; this.lblVOName = new Label(this.panel, SWT.NONE); this.lblVOName.setText(Messages.getString("AllowedVODialog_VOName")); //$NON-NLS-1$ Activator activator = Activator.getDefault(); IPreferenceStore preferenceStore = activator.getPreferenceStore(); this.txtVOName = new StoredCombo(this.panel, SWT.DROP_DOWN); this.txtVOName.setPreferences(preferenceStore, VONAME_STRINGS); this.txtVOName.setLayoutData(gData); /* Initial Values for Edit Operation */ if (this.editMode) { this.txtVOName.setText(this.newVO); } this.txtVOName.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { AllowedVOsDialog.this.newVO = AllowedVOsDialog.this.txtVOName.getText(); validateFields(); } }); //this.txtVOName.setLayoutData( gd ); Dialog.applyDialogFont(container); addVONames(); return parent; }
From source file:eu.geclipse.jsdl.ui.internal.dialogs.ArgumentsDialog.java
License:Open Source License
@SuppressWarnings("unchecked") @Override/*ww w . ja va2 s . com*/ protected Control createDialogArea(final Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridData gd = new GridData(GridData.FILL_BOTH); container.setLayout(new GridLayout(3, false)); container.setLayoutData(gd); this.panel = new Composite(container, SWT.NONE); GridLayout layout = new GridLayout(3, false); this.panel.setLayout(layout); gd = new GridData(GridData.FILL_HORIZONTAL); this.panel.setLayoutData(gd); /* ======================== File System Name Widgets =====================*/ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; this.lblFileSystemName = new Label(this.panel, SWT.NONE); this.lblFileSystemName.setText(Messages.getString("Dialog_FileSystem")); //$NON-NLS-1$ this.cmbFileSystemName = new Combo(this.panel, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); EList<FileSystemType> fileSystemList = null; if (this.jobDefinitionType.getJobDescription().getResources() != null) { try { fileSystemList = this.jobDefinitionType.getJobDescription().getResources().getFileSystem(); } catch (Exception e) { Activator.logException(e); } } if (fileSystemList != null) { Iterator<FileSystemType> it = fileSystemList.iterator(); while (it.hasNext()) { this.fileSystemType = it.next(); this.cmbFileSystemName.add(this.fileSystemType.getName()); } // end while } //end if /* Initial Values for Edit Operation */ if (this.editMode) { if (this.argumentType.getFilesystemName() != null) { this.cmbFileSystemName.setText(this.argumentType.getFilesystemName()); } } this.cmbFileSystemName.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(final SelectionEvent e) { // Auto-generated method stub } public void widgetSelected(final SelectionEvent e) { ArgumentsDialog.this.argumentType.setFilesystemName(ArgumentsDialog.this.cmbFileSystemName .getItem(ArgumentsDialog.this.cmbFileSystemName.getSelectionIndex())); validateFields(); } }); this.cmbFileSystemName.setLayoutData(gd); /* =========================== Value Widgets =============================*/ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; this.lblValue = new Label(this.panel, SWT.NONE); this.lblValue.setText(Messages.getString("Dialog_Value")); //$NON-NLS-1$ this.txtValue = new Text(this.panel, SWT.SINGLE | SWT.BORDER); /* Initial Values for Edit Operation */ if (this.editMode) { this.txtValue.setText(this.argumentType.getValue()); } this.txtValue.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { ArgumentsDialog.this.argumentType.setValue((ArgumentsDialog.this.txtValue.getText())); validateFields(); } }); this.txtValue.setLayoutData(gd); Dialog.applyDialogFont(container); return parent; }
From source file:eu.geclipse.jsdl.ui.internal.dialogs.CandidateHostsDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridData gd = new GridData(GridData.FILL_BOTH); container.setLayout(new GridLayout(1, false)); gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = true;//from w w w. j a v a 2s. c om container.setLayoutData(gd); this.panel = new Composite(container, SWT.NONE); GridLayout layout = new GridLayout(1, false); this.panel.setLayout(layout); gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = true; this.panel.setLayoutData(gd); Label label = new Label(this.panel, SWT.NONE); label.setText(Messages.getString("ResourcesPage_NewHostsDialogDescr")); //$NON-NLS-1$ label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); gd = new GridData(GridData.FILL_BOTH); gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = true; gd.verticalSpan = 3; gd.horizontalSpan = 2; gd.widthHint = 300; gd.heightHint = 100; Table table = new Table(this.panel, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK); table.setLayoutData(gd); this.hostsViewer = new CheckboxTableViewer(table); this.hostsViewer.setContentProvider(new FeatureContentProvider()); FeatureLabelProvider hostsLabelProvider = new FeatureLabelProvider(); hostsLabelProvider.setStringType(FeatureLabelProvider.STRING_TYPE_CANDIDATE_HOSTS); this.hostsViewer.setLabelProvider(hostsLabelProvider); this.hostsViewer.addCheckStateListener(new ICheckStateListener() { public void checkStateChanged(final CheckStateChangedEvent event) { setValue(CandidateHostsDialog.this.hostsViewer.getCheckedElements()); } }); try { Collection<String> computingElements = new ArrayList<String>(); IGridResource[] gridComputings = this.jobDescription.getProject().getVO().getInfoService() .fetchResources(this.jobDescription.getProject().getVO(), this.jobDescription.getProject().getVO(), GridResourceCategoryFactory.getCategory(GridResourceCategoryFactory.ID_COMPUTING), false, IGridComputing.class, new NullProgressMonitor()); // IGridComputing[] gridComputings = this.jobDescription.getProject().getVO() // .getComputing( new NullProgressMonitor() ) ; String hostnameOnly; for (int i = 0; i < gridComputings.length; i++) { /* Get only the CE host name substring * * Start from (last occurrence of empty space + 1) to remove the "CE @ " prefix. * Finish to the indexOf ":" character to remove any trailing characters. * */ if (gridComputings[i].getName().indexOf(":") != -1) { //$NON-NLS-1$ hostnameOnly = gridComputings[i].getName() .substring(gridComputings[i].getName().lastIndexOf(" ") + 1 //$NON-NLS-1$ , gridComputings[i].getName().indexOf(":")); //$NON-NLS-1$ /* * If there are elements in the Candidate Hosts Table Viewer then */ if (this.existingHostsInViewer != null) { /* check to see if the host name is already included. If not add it.*/ if (!this.existingHostsInViewer.contains(hostnameOnly)) { /* Check if the host name appears twice from the InfoSystem and if it does do not * include it twice. */ if (!computingElements.contains(hostnameOnly)) computingElements.add(hostnameOnly); } } else { /* Check if the host name appears twice from the InfoSystem and if it does do not * include it twice. */ if (!computingElements.contains(hostnameOnly)) computingElements.add(hostnameOnly); } } // end } this.hostsViewer.setInput(computingElements); } catch (Exception e) { Activator.logException(e); } Dialog.applyDialogFont(container); return parent; }
From source file:eu.geclipse.jsdl.ui.internal.dialogs.EnvironmentVarDialog.java
License:Open Source License
@SuppressWarnings("unchecked") @Override// w w w. ja va 2 s . co m protected Control createDialogArea(final Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridData gd = new GridData(GridData.FILL_BOTH); container.setLayout(new GridLayout(3, false)); container.setLayoutData(gd); this.panel = new Composite(container, SWT.NONE); GridLayout layout = new GridLayout(3, false); this.panel.setLayout(layout); gd = new GridData(GridData.FILL_HORIZONTAL); this.panel.setLayoutData(gd); /* =========================== Name Widgets =============================*/ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; this.lblName = new Label(this.panel, SWT.NONE); this.lblName.setText(Messages.getString("Dialog_Name")); //$NON-NLS-1$ this.txtName = new Text(this.panel, SWT.SINGLE | SWT.BORDER); /* Initial Values for Edit Operation */ if (this.editMode) { this.txtName.setText(this.environmentType.getName()); } this.txtName.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { EnvironmentVarDialog.this.environmentType.setName((EnvironmentVarDialog.this.txtName.getText())); validateFields(); } }); this.txtName.setLayoutData(gd); /* ======================== File System Name Widgets =====================*/ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; this.lblFileSystemName = new Label(this.panel, SWT.NONE); this.lblFileSystemName.setText(Messages.getString("Dialog_FileSystem")); //$NON-NLS-1$ this.cmbFileSystemName = new Combo(this.panel, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); EList<FileSystemType> fileSystemList = null; if (this.jobDefinitionType.getJobDescription().getResources() != null) { try { fileSystemList = this.jobDefinitionType.getJobDescription().getResources().getFileSystem(); } catch (Exception e) { Activator.logException(e); } } if (fileSystemList != null) { Iterator<FileSystemType> it = fileSystemList.iterator(); while (it.hasNext()) { this.fileSystemType = it.next(); this.cmbFileSystemName.add(this.fileSystemType.getName()); } // end while } //end if /* Initial Values for Edit Operation */ if (this.editMode) { if (this.environmentType.getFilesystemName() != null) { this.cmbFileSystemName.setText(this.environmentType.getFilesystemName()); } } this.cmbFileSystemName.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(final SelectionEvent e) { // Auto-generated method stub } public void widgetSelected(final SelectionEvent e) { EnvironmentVarDialog.this.environmentType .setFilesystemName(EnvironmentVarDialog.this.cmbFileSystemName .getItem(EnvironmentVarDialog.this.cmbFileSystemName.getSelectionIndex())); validateFields(); } }); this.cmbFileSystemName.setLayoutData(gd); /* =========================== Value Widgets =============================*/ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; this.lblValue = new Label(this.panel, SWT.NONE); this.lblValue.setText(Messages.getString("Dialog_Value")); //$NON-NLS-1$ this.txtValue = new Text(this.panel, SWT.SINGLE | SWT.BORDER); /* Initial Values for Edit Operation */ if (this.editMode) { this.txtValue.setText(this.environmentType.getValue()); } this.txtValue.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { EnvironmentVarDialog.this.environmentType.setValue((EnvironmentVarDialog.this.txtValue.getText())); validateFields(); } }); this.txtValue.setLayoutData(gd); Dialog.applyDialogFont(container); return parent; }
From source file:eu.geclipse.jsdl.ui.internal.dialogs.FileSystemsDialog.java
License:Open Source License
@Override protected Control createDialogArea(final Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridData gd = new GridData(GridData.FILL_BOTH); container.setLayout(new GridLayout(3, false)); container.setLayoutData(gd);/*w w w . ja v a 2 s. c om*/ this.panel = new Composite(container, SWT.NONE); GridLayout layout = new GridLayout(3, false); this.panel.setLayout(layout); gd = new GridData(GridData.FILL_HORIZONTAL); this.panel.setLayoutData(gd); /* ======================== File System Name Widgets =====================*/ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.grabExcessHorizontalSpace = true; gd.horizontalSpan = 2; this.lblFileSystemName = new Label(this.panel, SWT.NONE); this.lblFileSystemName.setText(Messages.getString("ResourcesPage_FileSystemName")); //$NON-NLS-1$ this.txtFileSystemName = new Text(this.panel, SWT.SINGLE | SWT.BORDER); /* Initial Values for Edit Operation */ if (this.editMode) { this.txtFileSystemName.setText(this.fileSystemType.getName()); } this.txtFileSystemName.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { FileSystemsDialog.this.fileSystemType.setName(FileSystemsDialog.this.txtFileSystemName.getText()); validateFields(); } }); this.txtFileSystemName.setLayoutData(gd); if (this.editMode) { this.txtFileSystemName.setText(this.fileSystemType.getName()); } /* =========================== Description Widgets =========================*/ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.verticalAlignment = GridData.BEGINNING; this.lblFileSystemDescr = new Label(this.panel, SWT.NONE); this.lblFileSystemDescr.setText(Messages.getString("ResourcesPage_Description")); //$NON-NLS-1$ this.lblFileSystemDescr.setLayoutData(gd); this.txtFileSystemDescr = new Text(this.panel, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP); gd = new GridData(GridData.FILL_HORIZONTAL); gd.grabExcessVerticalSpace = true; gd.horizontalSpan = 2; gd.heightHint = FileSystemsDialog.WIDGET_HEIGHT; /* Initial Values for Edit Operation */ if ((this.editMode) && (this.fileSystemType.getDescription() != null)) { this.txtFileSystemDescr.setText(this.fileSystemType.getDescription()); } this.txtFileSystemDescr.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { FileSystemsDialog.this.fileSystemType .setDescription(FileSystemsDialog.this.txtFileSystemDescr.getText()); } }); this.txtFileSystemDescr.setLayoutData(gd); /* ========================= Mount Point Widget ============================*/ gd = new GridData(); this.lblMountPoint = new Label(this.panel, SWT.NONE); this.lblMountPoint.setText(Messages.getString("ResourcesPage_MountPoint")); //$NON-NLS-1$ gd = new GridData(GridData.FILL_BOTH); gd.horizontalSpan = 2; this.txtMountPoint = new Text(this.panel, SWT.SINGLE | SWT.BORDER); /* Initial Values for Edit Operation */ if ((this.editMode) && (this.fileSystemType.getMountPoint() != null)) { if (this.fileSystemType.getMountPoint() != null) { this.txtMountPoint.setText(this.fileSystemType.getMountPoint()); } } this.txtMountPoint.addModifyListener(new ModifyListener() { public void modifyText(final ModifyEvent e) { FileSystemsDialog.this.fileSystemType.setMountPoint(FileSystemsDialog.this.txtMountPoint.getText()); } }); this.txtMountPoint.setLayoutData(gd); /* ========================= Mount Source Widget ============================*/ gd = new GridData(); this.lblMountSource = new Label(this.panel, SWT.NONE); this.lblMountSource.setText(Messages.getString("ResourcesPage_MountSource")); //$NON-NLS-1$ gd = new GridData(GridData.FILL_BOTH); gd.horizontalSpan = 2; this.txtMountSource = new Text(this.panel, SWT.SINGLE | SWT.BORDER); /* Initial Values for Edit Operation */ //TODO: nloulloud MountSource Not yet defined in the Model // if ( this.editMode ) { // if ( this.fileSystemType.get() != null ) { // this.txtMountSource.setText( this.fileSystemType.getMountPoint() ); // } // } // // this.txtMountSource.addModifyListener( new ModifyListener() { // // public void modifyText( final ModifyEvent e ) { // FileSystemsDialog.this.fileSystemType.setMountPoint( FileSystemsDialog.this.txtMountSource.getText() ); // // } // // }); this.txtMountSource.setLayoutData(gd); /* ======================== Disk Space Widgets =============================*/ gd = new GridData(); this.lblDiskSpace = new Label(this.panel, SWT.None); this.lblDiskSpace.setText(Messages.getString("ResourcesPage_DiskSpace")); //$NON-NLS-1$ this.txtDiskSpace = new Text(this.panel, SWT.SINGLE | SWT.BORDER); this.txtDiskSpace.setLayoutData(gd); gd = new GridData(GridData.FILL_BOTH); this.cmbDiskSpaceRange = new Combo(this.panel, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); this.cmbDiskSpaceRange.add(Messages.getString("ResourcesPage_LowBoundRange")); //$NON-NLS-1$ this.cmbDiskSpaceRange.add(Messages.getString("ResourcesPage_UpBoundRange")); //$NON-NLS-1$ this.cmbDiskSpaceRange.setLayoutData(gd); this.txtDiskSpace.addModifyListener(new ModifyListener() { BoundaryType boundaryType = JsdlFactory.eINSTANCE.createBoundaryType(); RangeValueType rangeValueType = JsdlFactory.eINSTANCE.createRangeValueType(); public void modifyText(final ModifyEvent e) { if (!FileSystemsDialog.this.txtDiskSpace.getText().equals("") //$NON-NLS-1$ && !FileSystemsDialog.this.editMode) { this.boundaryType.setValue(Double.parseDouble(FileSystemsDialog.this.txtDiskSpace.getText())); switch (FileSystemsDialog.this.cmbDiskSpaceRange.getSelectionIndex()) { /* INDEX 0 = UPPER RANGE */ case 0: this.rangeValueType.setLowerBound(this.boundaryType); break; /* INDEX 1 = UPPER RANGE */ case 1: this.rangeValueType.setUpperBound(this.boundaryType); break; default: break; } FileSystemsDialog.this.fileSystemType.setDiskSpace(this.rangeValueType); } } }); this.cmbDiskSpaceRange.addSelectionListener(new SelectionListener() { BoundaryType boundaryType = JsdlFactory.eINSTANCE.createBoundaryType(); RangeValueType rangeValueType = JsdlFactory.eINSTANCE.createRangeValueType(); public void widgetDefaultSelected(final SelectionEvent e) { /* Auto-generated method stub */ } public void widgetSelected(final SelectionEvent e) { if (!FileSystemsDialog.this.txtDiskSpace.getText().equals("")) { //$NON-NLS-1$ this.boundaryType.setValue(Double.parseDouble(FileSystemsDialog.this.txtDiskSpace.getText())); switch (FileSystemsDialog.this.cmbDiskSpaceRange.getSelectionIndex()) { /* INDEX 0 = UPPER RANGE */ case 0: this.rangeValueType.setLowerBound(this.boundaryType); break; /* INDEX 1 = UPPER RANGE */ case 1: this.rangeValueType.setUpperBound(this.boundaryType); break; default: break; } FileSystemsDialog.this.fileSystemType.setDiskSpace(this.rangeValueType); } // end_if equals "" } }); /* Initial Values for Edit Operation */ if (this.editMode) { RangeValueType rangeValueType = JsdlFactory.eINSTANCE.createRangeValueType(); rangeValueType = this.fileSystemType.getDiskSpace(); rangeValueType = (RangeValueType) checkProxy(rangeValueType); BoundaryType boundaryType = JsdlFactory.eINSTANCE.createBoundaryType(); if (this.fileSystemType.getDiskSpace() != null) { if (this.fileSystemType.getDiskSpace().getLowerBound() != null) { boundaryType = this.fileSystemType.getDiskSpace().getLowerBound(); /* check for Lazy Loading */ boundaryType = (BoundaryType) checkProxy(boundaryType); this.txtDiskSpace.setText(Double.toString(boundaryType.getValue())); /* Select the Lower Bound */ this.cmbDiskSpaceRange.select(0); } else { boundaryType = this.fileSystemType.getDiskSpace().getUpperBound(); /* check for Lazy Loading */ boundaryType = (BoundaryType) checkProxy(boundaryType); this.txtDiskSpace.setText(Double.toString(boundaryType.getValue())); /* Select the Lower Bound */ this.cmbDiskSpaceRange.select(1); } } //end_if (this.fileSystemType.getDiskSpace() != null ) } /* ========================= File System Widgets ===========================*/ this.lblFileSystemType = new Label(this.panel, SWT.NONE); this.lblFileSystemType.setText(Messages.getString("ResourcesPage_FileSysType")); //$NON-NLS-1$ gd = new GridData(GridData.FILL_BOTH); gd.horizontalSpan = 2; this.cmbFileSystemType = new Combo(this.panel, SWT.NONE | SWT.READ_ONLY | SWT.BORDER); /* Populate the Combo Box with the File System Type Literals */ EEnum cFEnum = JsdlPackage.Literals.FILE_SYSTEM_TYPE_ENUMERATION; for (int i = 0; i < cFEnum.getELiterals().size(); i++) { this.cmbFileSystemType.add(cFEnum.getEEnumLiteral(i).toString()); } this.cmbFileSystemType.setLayoutData(gd); this.cmbFileSystemType.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(final SelectionEvent e) { /* Auto-generated method stub */ } public void widgetSelected(final SelectionEvent e) { FileSystemsDialog.this.fileSystemType.setFileSystemType(FileSystemTypeEnumeration .get(FileSystemsDialog.this.cmbFileSystemType.getSelectionIndex())); } }); /* Initial Values for Edit Operation */ if (this.editMode) { this.cmbFileSystemType.setText(this.fileSystemType.getFileSystemType().toString()); } /* Hack to apply initial values to widgets */ if (this.editMode) { this.editMode = false; } Dialog.applyDialogFont(container); return parent; }