List of usage examples for org.eclipse.jface.dialogs IDialogConstants ENTRY_FIELD_WIDTH
int ENTRY_FIELD_WIDTH
To view the source code for org.eclipse.jface.dialogs IDialogConstants ENTRY_FIELD_WIDTH.
Click Source Link
From source file:com.drgarbage.bytecode.jdi.dialogs.SelectJavaTypeDialog.java
License:Apache License
private void createDebugTargetSelectionTable(Composite parent) { tableViewer = new TableViewer(parent, SWT.BORDER); Table t = tableViewer.getTable();/*from w ww .j a v a2 s .c o m*/ t.setHeaderVisible(true); TableColumn tc1 = new TableColumn(t, SWT.NONE); tc1.setText(BytecodeVisualizerMessages.SelectJavaTypeDialog_column_Type); TableColumn tc2 = new TableColumn(t, SWT.NONE); tc2.setText(BytecodeVisualizerMessages.SelectJavaTypeDialog_column_Class_Loader); tableViewer.addDoubleClickListener(new IDoubleClickListener() { public void doubleClick(DoubleClickEvent event) { buttonPressed(OK); } }); tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { updateEnablement(); } }); tableViewer.setContentProvider(new ArrayContentProvider()); // vmsTableViewer.setLabelProvider(new DefaultLabelProvider()); tableViewer.setLabelProvider(new ITableLabelProvider() { public void addListener(ILabelProviderListener listener) { } public void dispose() { } public Image getColumnImage(Object element, int columnIndex) { if (columnIndex == 0) { return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_CLASS); } return null; } public String getColumnText(Object element, int columnIndex) { if (element instanceof JDIReferenceType) { try { JDIReferenceType jt = (JDIReferenceType) element; if (columnIndex == 0) { return jt.getName(); } else if (columnIndex == 1) { IJavaObject o = jt.getClassLoaderObject(); return o.getJavaType().getName() + JavaLexicalConstants.SPACE + JavaLexicalConstants.LEFT_PARENTHESIS + ByteCodeConstants.ID + JavaLexicalConstants.EQUALS + o.getUniqueId() + JavaLexicalConstants.RIGHT_PARENTHESIS; } } catch (DebugException ignore) { } } return null; } public boolean isLabelProperty(Object element, String property) { return false; } public void removeListener(ILabelProviderListener listener) { } }); tableViewer.addFilter(new ViewerFilter() { public boolean select(Viewer viewer, Object parentElement, Object element) { return true; } }); tableViewer.setInput(displayCandidates); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.heightHint = IDialogConstants.ENTRY_FIELD_WIDTH; t.setLayoutData(data); tc1.pack(); tc2.pack(); }
From source file:com.iauto.mist.spec.m2t.uml2html.dialog.ModelURIChooseDialog.java
License:Open Source License
private void createProjectSelectionTable(Composite radioGroup) { projectNames = CheckboxTableViewer.newCheckList(radioGroup, SWT.BORDER); projectNames.setContentProvider(new ModelURIContentProvider()); projectNames.setLabelProvider(new ModelURILabelProvider()); // projectNames.setComparator( new ResourceComparator( ResourceComparator.NAME ) ); // projectNames.addFilter( new ViewerFilter() { // private final IProject[] projectHolder = new IProject[1]; ///*from w w w .j a v a2 s . c o m*/ // public boolean select( Viewer viewer, Object parentElement, Object element ) { // if ( !( element instanceof IProject ) ) { // return false; // } // IProject project = (IProject) element; // if ( !project.isAccessible() ) { // return false; // } // projectHolder[0] = project; // return BuildUtilities.isEnabled( projectHolder, IncrementalProjectBuilder.CLEAN_BUILD ); // } // } ); projectNames.setInput(original.toArray(new Model[original.size()])); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.heightHint = IDialogConstants.ENTRY_FIELD_WIDTH; projectNames.getTable().setLayoutData(data); //table is disabled to start because all button is selected // projectNames.getTable().setEnabled( selectedButton.getSelection() ); setCheckboxTableBackground(); projectNames.addCheckStateListener(new ICheckStateListener() { public void checkStateChanged(CheckStateChangedEvent event) { if (allButton.getSelection()) { projectNames.setAllChecked(true); } else { selection = projectNames.getCheckedElements(); updateOKButton(); } } }); // projectNames.setCheckedElements( selection ); }
From source file:com.iauto.mist.spec.m2t.uml2html.dialog.StateMachineChooseDialog.java
License:Open Source License
private void createProjectSelectionTable(Composite radioGroup) { projectNames = CheckboxTableViewer.newCheckList(radioGroup, SWT.BORDER); projectNames.setContentProvider(new StmContentProvider()); projectNames.setLabelProvider(new StateMachineLabelProvider()); // projectNames.setComparator( new ResourceComparator( ResourceComparator.NAME ) ); // projectNames.addFilter( new ViewerFilter() { // private final IProject[] projectHolder = new IProject[1]; //// w w w . java2 s .co m // public boolean select( Viewer viewer, Object parentElement, Object element ) { // if ( !( element instanceof IProject ) ) { // return false; // } // IProject project = (IProject) element; // if ( !project.isAccessible() ) { // return false; // } // projectHolder[0] = project; // return BuildUtilities.isEnabled( projectHolder, IncrementalProjectBuilder.CLEAN_BUILD ); // } // } ); projectNames.setInput(original.toArray(new StateMachine[original.size()])); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.heightHint = IDialogConstants.ENTRY_FIELD_WIDTH; projectNames.getTable().setLayoutData(data); //table is disabled to start because all button is selected // projectNames.getTable().setEnabled( selectedButton.getSelection() ); setCheckboxTableBackground(); projectNames.addCheckStateListener(new ICheckStateListener() { public void checkStateChanged(CheckStateChangedEvent event) { if (allButton.getSelection()) { projectNames.setAllChecked(true); } else { selection = projectNames.getCheckedElements(); updateOKButton(); } } }); // projectNames.setCheckedElements( selection ); }
From source file:com.ibm.research.tagging.java.dialogs.SynchronizeWaypointsDialog.java
License:Open Source License
private void createProjectSelectionTable(Composite radioGroup) { projectNames = CheckboxTableViewer.newCheckList(radioGroup, SWT.BORDER); projectNames.setContentProvider(new WorkbenchContentProvider()); projectNames.setLabelProvider(new WorkbenchLabelProvider()); projectNames.setSorter(new ResourceSorter(ResourceSorter.NAME)); projectNames.addFilter(new ViewerFilter() { private final IProject[] projectHolder = new IProject[1]; public boolean select(Viewer viewer, Object parentElement, Object element) { if (!(element instanceof IProject)) { return false; }//from w ww . ja v a 2 s . c o m IProject project = (IProject) element; if (!project.isAccessible()) { return false; } projectHolder[0] = project; return true; } }); projectNames.setInput(ResourcesPlugin.getWorkspace().getRoot()); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.heightHint = IDialogConstants.ENTRY_FIELD_WIDTH; projectNames.getTable().setLayoutData(data); projectNames.setCheckedElements(fSelection); //table is disabled to start because all button is selected projectNames.getTable().setEnabled(selectedButton.getSelection()); projectNames.addCheckStateListener(new ICheckStateListener() { public void checkStateChanged(CheckStateChangedEvent event) { fSelection = projectNames.getCheckedElements(); updateEnablement(); } }); }
From source file:com.ibm.rtc.extensions.load.workspace.from.label.client.BasicConfigurationElementEditor.java
License:Open Source License
protected Text createLabeledText(Composite parent, String labelText, String description, String textValue) { FormToolkit toolkit = getManagedForm().getToolkit(); // Label//from www . j av a 2 s . c om Label label = toolkit.createLabel(parent, labelText); label.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE)); // Text field Text text = toolkit.createText(parent, textValue); TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB); layoutData.maxWidth = IDialogConstants.ENTRY_FIELD_WIDTH; text.setLayoutData(layoutData); // Description under text field createSpacer(parent, SWT.DEFAULT, 1); Label descriptionLabel = toolkit.createLabel(parent, description, SWT.WRAP); descriptionLabel.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); descriptionLabel.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY)); return text; }
From source file:com.jcraft.eclipse.jcterm.internal.OpenConnectionDialog.java
License:Open Source License
/** * Creates the widgets that represent the entry area. * //from w w w . java 2 s . com * @param parent * the parent of the widgets */ protected void createFields(Composite parent) { texts = new Text[prompt.length]; for (int i = 0; i < prompt.length; i++) { new Label(parent, SWT.NONE).setText(prompt[i]); int flag = SWT.BORDER; if (!echo[i]) { flag |= SWT.PASSWORD; } texts[i] = new Text(parent, flag); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH); texts[i].setLayoutData(data); if (!echo[i]) { texts[i].setEchoChar('*'); } } }
From source file:com.motorola.studio.android.common.utilities.ui.WidgetsFactory.java
License:Apache License
/** * Creates a new combo./*from w w w. ja v a2s. c om*/ * * @param parent The parent composite. * @return The new combo */ public static Combo createCombo(Composite parent) { Combo toReturn = new Combo(parent, SWT.READ_ONLY); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.horizontalSpan = 1; toReturn.setLayoutData(data); return toReturn; }
From source file:com.motorola.studio.android.common.utilities.ui.WidgetsFactory.java
License:Apache License
/** * Creates a new table widget.// w w w .ja v a 2 s. c o m * * @param parent The parent composite. * @return The new table */ public static Table createTable(Composite parent) { Table toReturn = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER); GridData data = new GridData(GridData.FILL_BOTH); data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.heightHint = toReturn.getItemHeight(); data.horizontalSpan = 1; toReturn.setLayoutData(data); return toReturn; }
From source file:com.motorola.studio.android.common.utilities.ui.WidgetsFactory.java
License:Apache License
/** * Creates a new table widget./*from w w w.j a v a 2s. c o m*/ * * @param parent The parent composite. * @return The new table */ public static Table createTableMultiSelection(Composite parent) { Table toReturn = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI); GridData data = new GridData(GridData.FILL_BOTH); data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.heightHint = toReturn.getItemHeight(); data.horizontalSpan = 1; toReturn.setLayoutData(data); return toReturn; }
From source file:com.motorola.studio.android.common.utilities.ui.WidgetsFactory.java
License:Apache License
/** * Creates a new text./*from w w w.j av a 2 s . com*/ * * @param parent The parent composite. * @return The new text. */ public static Text createText(Composite parent) { Text toReturn = new Text(parent, SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; toReturn.setLayoutData(data); return toReturn; }