text.setText(prettyJsonString); } catch (JsonSyntaxException e) { textType.select(currentTextType); throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.JSONEXCEPTION)); text.setText(out.getBuffer().toString()); } catch (DocumentException e) { textType.select(currentTextType); throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.XMLEXCEPTION)); } catch (IOException e) {
private void tranformImage(Combo imageType, Label label) { int index = imageType.getSelectionIndex(); if (index == 0) { BASE64Decoder decode = new BASE64Decoder(); try { byte[] b = decode.decodeBuffer(value); ByteArrayInputStream bais = new ByteArrayInputStream(b); Image img = new Image(shell.getDisplay(), bais); label.setImage(img); } catch (SWTException e) { imageType.select(currentImageType); throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.IMAGEEXCEPTION)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } shell.pack(); setMiddle(); }
final Combo textType = new Combo(grpValueType, SWT.DROP_DOWN | SWT.READ_ONLY); textType.setItems(new String[] { RedisClient.i18nFile.getText(I18nFile.PLAINTEXT), RedisClient.i18nFile.getText(I18nFile.JSON), RedisClient.i18nFile.getText(I18nFile.XML) }); textType.select(0);
comboCube.select( 0 ); comboUpdateMode.add( option.getDescription() ); comboUpdateMode.select( comboUpdateMode.indexOf( this.updateOptions.getDescription( meta.getUpdateMode() ) ) ); comboSplashMode.select( comboSplashMode.indexOf( this.splashOptions.getDescription( meta.getSplashMode() ) ) ); comboMeasureType.select( 0 ); if ( meta.getMeasureType() != null ) { int indexType = comboMeasureType.indexOf( meta.getMeasureType() ); if ( indexType >= 0 ) { comboMeasureType.select( indexType );
private void fillStoredData() { if ( stepname != null ) { textStepName.setText( stepname ); } int index = addConnectionLine.indexOf( meta.getDatabaseMeta() != null ? meta.getDatabaseMeta().getName() : "" ); if ( index >= 0 ) { addConnectionLine.select( index ); } if ( meta.getDimension() != null ) { comboDimension.add( meta.getDimension() ); comboDimension.select( 0 ); } buttonBaseElementsOnly.setSelection( meta.getBaseElementsOnly() ); tableViewFields.table.removeAll(); if ( meta.getLevels().size() > 0 ) { for ( PaloDimensionLevel level : meta.getLevels() ) { tableViewFields.add( level.getLevelName(), String.valueOf( level.getLevelNumber() ), level.getFieldName(), level.getFieldType() ); } tableViewFields.setRowNums(); tableViewFields.optWidth( true ); } }
LanguageChoice.getInstance().getDefaultLocale().toString(), GlobalMessages.localeCodes ); if ( idxDefault >= 0 ) { wDefaultLocale.select( idxDefault );
@Override public IStatus runInUIThread(IProgressMonitor monitor) { memoryBlock.add(DebugUIMessages.AddMemoryRenderingDialog_Add_New); memoryBlock.select(0); return Status.OK_STATUS; } };
/** * @param portName The portName to set. */ public void setPortNames(String[] portNames) { portNameCombo.setItems(portNames); portNameCombo.select(0); }
@Override protected void listSetSelection(int[] ixs) { if (combo == null) { for (int ix : ixs) { ccombo.select(ix); } } else { for (int ix : ixs) { combo.select(ix); } } }
/** * @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(List, boolean) */ protected void setSelectionToWidget(List l, boolean reveal) { Combo combo = getCombo(); if (l == null || l.size() == 0) { combo.clearSelection(); } else { combo.select(listMap.indexOf(l.get(0))); } }
private void updateProviderList() { String defaultProvider= fStore.getString(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER); for (int j= 0; j < fQuickDiffProviderListModel.length; j++) { if (defaultProvider.equals(fQuickDiffProviderListModel[j][0])) { fQuickDiffProviderCombo.select(j); } } fQuickDiffProviderCombo.redraw(); }
/** * Displays value in text based on default unit . * * @param bytes * Amount of bytes. */ private void displayValue(long bytes) { int exp = getUnit(bytes); unitCombo.select(exp); displayValue(bytes, exp); }
@Override public void runSupport() { if (list == null || list.isDisposed()) { return; } if (list.getSelectionIndex() != index) { list.select(index); } } });
/** * <code>setEncoding</code> Set the selection in the combo to the * descriptive encoding name. * * @param enc * a <code>string</code> value. Note this is not the IANA * tag. */ public void setEncoding(String enc) { encodingCombo.setText(enc); encodingCombo.select(encodingCombo.indexOf(enc)); }
private void initDefault() { if (fFormatterCombo == null) { return; } String formatterID= fPrefs.get(JavaCore.JAVA_FORMATTER, fDefaultFormatterId); fFormatterCombo.select(getFormatterIndex(formatterID)); }
private void updateQueueLocationCombo() { if (cmbQueueLocation == null) return; String[] sItemsText = new String[MSGKEY_QUEUELOCATIONS.length]; for (int i = 0; i < MSGKEY_QUEUELOCATIONS.length; i++) { String sText = MessageText.getString(MSGKEY_QUEUELOCATIONS[i]); sItemsText[i] = sText; } cmbQueueLocation.setItems(sItemsText); cmbQueueLocation.select(torrentOptions.getQueueLocation()); }
protected void initializeTargetCombo() { IConfigurationElement[] elements = PDECore.getDefault().getTargetProfileManager().getSortedTargets(); fTargetIds = new String[elements.length]; for (int i = 0; i < elements.length; i++) { String name = elements[i].getAttribute("name"); //$NON-NLS-1$ if (fTargets.indexOf(name) == -1) fTargets.add(name); fTargetIds[i] = elements[i].getAttribute("id"); //$NON-NLS-1$ } if (elements.length > 0) fTargets.select(0); }
private void doPopulateDialog(Combo combo, ListViewer viewer, String[] labels, int selectionIdx, IMemoryBlock currentBlock) { // clean up combo.removeAll(); for (int i = 0; i < labels.length; i++) { combo.add(labels[i]); } combo.select(selectionIdx); fSelectedMemoryBlock = currentBlock; viewer.setInput(currentBlock); }