@Override public void widgetSelected(SelectionEvent e) { tranformImage(imageType, label); currentImageType = imageType.getSelectionIndex(); } });
@Override public void widgetSelected(SelectionEvent e) { tranformText(textType, text); currentTextType = textType.getSelectionIndex(); } });
private void tranformText(final Combo textType, final Text text) { int index = textType.getSelectionIndex(); if (index == 0) { text.setText(value);
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(); }
props.setShowingHelpToolTips( helptipBtn.getSelection() ); int defaultLocaleIndex = wDefaultLocale.getSelectionIndex(); if ( defaultLocaleIndex < 0 || defaultLocaleIndex >= GlobalMessages.localeCodes.length ) {
@Override public void handleEvent( Event e ) { persist_for_secs = duration_secs[ durations_combo.getSelectionIndex()]; } });
public IType getDestinationType() { final int index= fSuperTypesCombo.getSelectionIndex(); if (index >= 0) return fCandidateTypes[index]; return null; }
private boolean getMinInclusive() { if (fMinVersionBound != null) return fMinVersionBound.getSelectionIndex() == 0; return false; }
/** * @return Returns selected repository or null. */ public CmrRepositoryDefinition getSelectedRepository() { if (cmrRepositoryCombo.getSelectionIndex() != -1) { return cmrRepositories.get(cmrRepositoryCombo.getSelectionIndex()); } return null; }
/** * @return Returns {@link CmrRepositoryDefinition} if any is selected for import. */ public CmrRepositoryDefinition getCmrRepositoryDefinition() { if (-1 != cmrCombo.getSelectionIndex()) { return cmrRepositoryList.get(cmrCombo.getSelectionIndex()); } return null; } }
/** * @return Returns current size defined by spinner and unit. */ private long getCurrentSize() { return (long) (Double.parseDouble(valueText.getText()) * Math.pow(1024, unitCombo.getSelectionIndex())); }
@Override public void widgetSelected(SelectionEvent e) { setSelectedStartMode(cmbStartMode.getSelectionIndex()); } });
@Override public void widgetSelected(SelectionEvent e) { final int index= fProfileCombo.getSelectionIndex(); fProfileManager.setSelected(fSortedProfiles.get(index)); }
public int getSelectionIndex() { if (combo instanceof Combo) return ((Combo) combo).getSelectionIndex(); return ((CCombo) combo).getSelectionIndex(); }
@Override public void runSupport() { if (list == null || list.isDisposed()) { return; } if (list.getSelectionIndex() != index) { list.select(index); } } });
private void updateInfos() { int selection = servicesList.getSelectionIndex(); serviceDescription.setText(services[selection].getDescription()); serviceUrl.setText(services[selection].getURL()); ((IpCheckerWizard)wizard).selectedService = services[selection]; ((IpCheckerWizard)wizard).setFinishEnabled( services[selection].supportsCheck()); }
private void doSelectionChanged(SelectionEvent e) { if (isOkToUse(fComboControl)) { fItems= fComboControl.getItems(); fText= fComboControl.getText(); fSelectionIndex= fComboControl.getSelectionIndex(); } dialogFieldChanged(); }
@Override public void handleEvent(Event e) { int selection = configList.getSelectionIndex(); String selected = configList.getItem(selection); TrackersUtil.getInstance().removeWebSeed(selected); refreshList(""); refreshDetails(); setEditDeleteEnable(); } });
public void widgetSelected(SelectionEvent e) { int index= combo.getSelectionIndex(); EnumValue value= domain.getValueByIndex(index); IStatus status= domain.validate(value); if (!status.matches(IStatus.ERROR)) fOverlayStore.setValue(preference.getKey(), value.getIntValue()); updateStatus(status); } });
private void updateText() { if( ( style & SWT.READ_ONLY ) == 0 ) { int selectionIndex = getSelectionIndex(); String text = selectionIndex != -1 ? getItem( selectionIndex ) : ""; if( internalSetText( text, false ) ) { adjustSelection(); notifyListeners( SWT.Modify, new Event() ); } } else { notifyListeners( SWT.Modify, new Event() ); } }