/** * @return Returns <code>false</code> if no Template is available, * and <code>true</code> otherwise. */ public boolean isAnyTemplateAvailable() { if (wizardSelectionViewer != null) { wizardSelectionViewer.refresh(); Object firstElement = wizardSelectionViewer.getElementAt(0); if (firstElement != null) { return true; } } return false; } }
/** * Returns dependencies currently chosen by the user. * * @return dependencies currently chosen by the user. Neither the array nor any of its elements is <code>null</code>. */ public Dependency[] getDependencies() { List<Dependency> dependencies = new ArrayList<Dependency>(); for(int i = 0; i < dependencyViewer.getTable().getItemCount(); i++ ) { Object element = dependencyViewer.getElementAt(i); if(element instanceof Dependency) { dependencies.add((Dependency) element); } } return dependencies.toArray(new Dependency[dependencies.size()]); }
public void onSetActive() { if (tableViewer == null) return; Object obj = tableViewer.getElementAt(0); if (obj != null) tableViewer.setSelection(new StructuredSelection(obj)); }
protected void finishedFetchingElements(Object o) { Object element = configsViewer.getElementAt(0); if (element != null) configsViewer.setSelection(new StructuredSelection(element)); } };
List<File> getFilesToImport() { List<File> files = new ArrayList<File>(fileTable.getTable().getItemCount()); for (int i = 0; i < fileTable.getTable().getItemCount(); i++) { files.add((File) fileTable.getElementAt(i)); } return files; }
void fireSelection() { IStructuredSelection sel = fPluginViewer.getStructuredSelection(); if (!sel.isEmpty()) { fPluginViewer.setSelection(fPluginViewer.getStructuredSelection()); } else if (fPluginViewer.getElementAt(0) != null) { fPluginViewer.setSelection(new StructuredSelection(fPluginViewer.getElementAt(0))); } }
void fireSelection() { IStructuredSelection sel = fPluginViewer.getStructuredSelection(); if (!sel.isEmpty()) { fPluginViewer.setSelection(fPluginViewer.getStructuredSelection()); } else if (fPluginViewer.getElementAt(0) != null) { fPluginViewer.setSelection(new StructuredSelection(fPluginViewer.getElementAt(0))); } }
void fireSelection() { IStructuredSelection sel = fIncludesViewer.getStructuredSelection(); if (!sel.isEmpty()) { fIncludesViewer.setSelection(fIncludesViewer.getStructuredSelection()); } else if (fIncludesViewer.getElementAt(0) != null) { fIncludesViewer.setSelection(new StructuredSelection(fIncludesViewer.getElementAt(0))); } }
private void initialize() { initializeFields(); for (int i= 0, n= fSyntaxColorListModel.length; i < n; i++) fHighlightingColorList.add(new HighlightingColorListItem (fSyntaxColorListModel[i][0], fSyntaxColorListModel[i][1], fSyntaxColorListModel[i][1] + BOLD, fSyntaxColorListModel[i][1] + ITALIC, fSyntaxColorListModel[i][1] + STRIKETHROUGH, fSyntaxColorListModel[i][1] + UNDERLINE, null)); fHighlightingColorListViewer.setInput(fHighlightingColorList); fHighlightingColorListViewer.setSelection(new StructuredSelection(fHighlightingColorListViewer.getElementAt(0))); }
@Override protected Control createDialogContentArea(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(4, false); gridLayout.marginHeight = 0; composite.setLayout(gridLayout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); createInvisibleTable(composite); createMoveButtons(composite); createVisibleTable(composite); createUpDownBtt(composite); createWidthArea(composite); Object element = visibleViewer.getElementAt(0); if (element != null) { visibleViewer.setSelection(new StructuredSelection(element)); } visibleViewer.getTable().setFocus(); return composite; }
private void initialize() { initializeFields(); for (int i = 0, n = fSyntaxColorListModel.length; i < n; i++) { fHighlightingColorList.add(new HighlightingColorListItem(fSyntaxColorListModel[i][0], fSyntaxColorListModel[i][1], fSyntaxColorListModel[i][1] + AntEditorPreferenceConstants.EDITOR_BOLD_SUFFIX, fSyntaxColorListModel[i][1] + AntEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX, null)); } fHighlightingColorListViewer.setInput(fHighlightingColorList); fHighlightingColorListViewer.setSelection(new StructuredSelection(fHighlightingColorListViewer.getElementAt(0))); }
public void modifyText( ModifyEvent e ) { availableObjectClassesViewer.refresh(); if ( availableObjectClassesViewer.getTable().getItemCount() >= 1 ) { Object item = availableObjectClassesViewer.getElementAt( 0 ); availableObjectClassesViewer.setSelection( new StructuredSelection( item ) ); } } } );
public void keyPressed(KeyEvent e) { if(e.keyCode == SWT.ARROW_DOWN) { viewer.getTable().setFocus(); viewer.getTable().setSelection(0); viewer.setSelection(new StructuredSelection(viewer.getElementAt(0)), true); } } });
@Override public void getValue(AccessibleControlEvent e) { int childIndex = e.childID; if (childIndex == ACC.CHILDID_SELF) { super.getValue(e); return; } Object item = viewer.getElementAt(childIndex); if (item instanceof IMarker) { IMarker marker = (IMarker) item; //If it is editable all we need is completeness // the rest is found by the table accessibility if (MarkerUtil.isEditable(marker)) { e.result = MarkerUtil.getCompleteText(marker); } else { //Otherwise all it needs is severity e.result = MarkerUtil.getKindText(marker); } } else { super.getValue(e); return; } }
@Override public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.ARROW_DOWN) { TableViewer tableViewer = getTableViewer(); tableViewer.getTable().setFocus(); if (tableViewer.getSelection().isEmpty()) { Object firstElement = tableViewer.getElementAt(0); if (firstElement != null) { tableViewer.setSelection(new StructuredSelection(firstElement)); } } } } });
private void initialize() { initializeFields(); for (int i= 0, n= fSyntaxColorListModel.length; i < n; i++) fHighlightingColorList.add(new HighlightingColorListItem (fSyntaxColorListModel[i][0], fSyntaxColorListModel[i][1], fSyntaxColorListModel[i][1] + BOLD, fSyntaxColorListModel[i][1] + ITALIC, fSyntaxColorListModel[i][1] + STRIKETHROUGH, fSyntaxColorListModel[i][1] + UNDERLINE, null)); fHighlightingColorListViewer.setInput(fHighlightingColorList); fHighlightingColorListViewer.setSelection(new StructuredSelection(fHighlightingColorListViewer.getElementAt(0))); // Make sure we propagate the colors to the shared color manager IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools(); PropertiesFileSourceViewerConfiguration sharedPropertiesFileSourceViewerConfiguration= new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING); new SourcePreviewerUpdater(fPreviewViewer, sharedPropertiesFileSourceViewerConfiguration, store); }
@Override public void createControl(Composite parent2) { Composite top = new Composite(parent2, SWT.NULL); top.setLayout(new GridLayout()); setControl(top); PlatformUI.getWorkbench().getHelpSystem().setHelp(top, IHelpContextIds.REFRESH_WIZARD_SELECTION_PAGE); Label l = new Label(top, SWT.NULL); l.setText(TeamUIMessages.GlobalRefreshParticipantSelectionPage_3); fViewer = new TableViewer(top, SWT.BORDER); GridData data = new GridData(GridData.FILL_BOTH); fViewer.getControl().setLayoutData(data); fViewer.setContentProvider(new MyContentProvider()); fViewer.addDoubleClickListener(this); fViewer.setLabelProvider(new MyLabelProvider()); fViewer.setComparator(new ResourceComparator(ResourceComparator.NAME)); fViewer.setInput(TeamUI.getSynchronizeManager()); fViewer.addSelectionChangedListener(this); Object toSelect= getDefaultSelection(); if (toSelect == null) { toSelect= fViewer.getElementAt(0); } if (toSelect != null) { fViewer.setSelection(new StructuredSelection(toSelect), true); } fViewer.getTable().setFocus(); Dialog.applyDialogFont(parent2); }
private void initialize() { initializeFields(); for (int i= 0, n= fSyntaxColorListModel.length; i < n; i++) fHighlightingColorList.add(new HighlightingColorListItem (fSyntaxColorListModel[i][0], fSyntaxColorListModel[i][1], fSyntaxColorListModel[i][1] + BOLD, fSyntaxColorListModel[i][1] + ITALIC, fSyntaxColorListModel[i][1] + STRIKETHROUGH, fSyntaxColorListModel[i][1] + UNDERLINE, null)); fHighlightingColorListViewer.setInput(fHighlightingColorList); fHighlightingColorListViewer.setSelection(new StructuredSelection(fHighlightingColorListViewer.getElementAt(0))); // Make sure we propagate the colors to the shared color manager IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools(); PropertiesFileSourceViewerConfiguration sharedPropertiesFileSourceViewerConfiguration= new PropertiesFileSourceViewerConfiguration(textTools.getColorManager(), store, null, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING); new SourcePreviewerUpdater(fPreviewViewer, sharedPropertiesFileSourceViewerConfiguration, store); }
public void performDefaults() { IPreferenceStore store = PDEPlugin.getDefault().getPreferenceStore(); int count = fElementViewer.getTable().getItemCount(); for (int i = 0; i < count; i++) { ColorElement item = (ColorElement) fElementViewer.getElementAt(i); RGB rgb = PreferenceConverter.getDefaultColor(store, item.getColorKey()); item.setColorValue(rgb); item.setBold(store.getDefaultBoolean(item.getColorKey() + IPDEColorConstants.P_BOLD_SUFFIX)); item.setItalic(store.getDefaultBoolean(item.getColorKey() + IPDEColorConstants.P_ITALIC_SUFFIX)); } ColorElement element = getColorElement(fElementViewer); fColorSelector.setColorValue(element.fColorValue); fBoldButton.setSelection(element.isBold()); fItalicButton.setSelection(element.isItalic()); }
public void performOk() { IPreferenceStore store = PDEPlugin.getDefault().getPreferenceStore(); int count = fElementViewer.getTable().getItemCount(); for (int i = 0; i < count; i++) { ColorElement item = (ColorElement) fElementViewer.getElementAt(i); PreferenceConverter.setValue(store, item.getColorKey(), item.getColorValue()); store.setValue(item.getColorKey() + IPDEColorConstants.P_BOLD_SUFFIX, item.isBold()); store.setValue(item.getColorKey() + IPDEColorConstants.P_ITALIC_SUFFIX, item.isItalic()); } }