private void selectButtonGroup( List<Button> buttons, int data ) { for ( Button b: buttons ){ b.setSelection( (Integer)b.getData() == data ); } }
/** * Returns the value of the given button. * * @param button the button for which to fetch value * @return the value of the button */ private int getIntData(Button button) { return ((Integer)button.getData()).intValue(); }
private int getIntValue(Button button) { Integer bData= (Integer) button.getData(); if (bData != null) { return bData.intValue(); } return 0; }
private void selectButtonGroup( List<Button> buttons, String data ) { for ( Button b: buttons ){ String str = (String)b.getData(); b.setSelection( str != null && str.endsWith( data )); } }
@Override public void widgetSelected(SelectionEvent e) { int index = listLogTypes.getSelectionIndex(); if (index < 0 || index >= logTypes.length) return; Button item = (Button) e.widget; if (item.getSelection()) ignoredComponents[index].remove(item.getData("LOGID")); else ignoredComponents[index].add(item.getData("LOGID")); } };
@Override public void handleEvent(Event event) { Button btn = (Button) event.widget; String sName = (String) btn.getData("ColorName"); if (sName != null) { COConfigurationManager.setParameter(sName + ".override", false); btn.setEnabled(false); } } });
public void widgetSelected(SelectionEvent e) { int i = 0; for (Iterator it = m_Buttons.iterator(); it.hasNext(); i++) { Button button = (Button)it.next(); ((EngineeringOption) button.getData()).setBoolean(((Boolean)m_Default.get(i)).booleanValue()); button.setSelection(((Boolean)m_Default.get(i)).booleanValue()); } }
public void widgetSelected(SelectionEvent e) { for (Iterator it = m_Buttons.iterator(); it.hasNext(); ) { Button button = (Button)it.next(); ((EngineeringOption) button.getData()).setBoolean(false); button.setSelection(false); } }
protected Button getCheckBox(Key key) { for (int i= fCheckBoxes.size() - 1; i >= 0; i--) { Button curr= (Button) fCheckBoxes.get(i); ControlData data= (ControlData) curr.getData(); if (key.equals(data.getKey())) { return curr; } } return null; }
protected Link getCheckBoxLink(Key key) { if (fCheckBoxes == null) return null; for (int i= fCheckBoxes.size() - 1; i >= 0; i--) { Button curr= fCheckBoxes.get(i); ControlData data= (ControlData) curr.getData(); if (key.equals(data.getKey()) && data instanceof LinkControlData) { return ((LinkControlData)data).getLink(); } } return null; }
protected Link getCheckBoxLink(Key key) { if (fCheckBoxes == null) return null; for (int i= fCheckBoxes.size() - 1; i >= 0; i--) { Button curr= fCheckBoxes.get(i); ControlData data= (ControlData) curr.getData(); if (key.equals(data.getKey()) && data instanceof LinkControlData) { return ((LinkControlData)data).getLink(); } } return null; }
void updateEnablement() { if (updateButton == null || updateButton.isDisposed()) return; Button[] buttons = {updateButton, uninstallButton, propertiesButton}; for (int i = 0; i < buttons.length; i++) { Action action = (Action) buttons[i].getData(BUTTON_ACTION); if (action == null || !action.isEnabled()) buttons[i].setEnabled(false); else buttons[i].setEnabled(true); } }
private void handleScopeChanged(SelectionEvent e) { Object source= e.getSource(); if (source instanceof Button) { Button button= (Button) source; if (button.getSelection()) setSelectedScope(((Integer) button.getData()).intValue()); } }
private String gatherSettings() { String[][] settings = new String[checkBoxButtons.length][3]; for (int i = 0; i < checkBoxButtons.length; i++) { Button currentCheckBox = checkBoxButtons[i]; String name = currentCheckBox.getText(); String value = (String) currentCheckBox.getData(); String checked = String.valueOf(currentCheckBox.getSelection()); settings[i] = new String[] { name, value, checked }; } return calculateResult(settings); }
@Override public void runSupport() { boolean i2p_installed = I2PHelpers.isI2PInstalled(); i2p_install_button.setText( MessageText.getString( i2p_installed?"devices.installed":"privacy.view.install.i2p" )); i2p_install_button.setEnabled( !i2p_installed ); i2p_lookup_button.setEnabled( i2p_installed && i2p_lookup_button.getData( "hash" ) != null ); i2p_options_link.setEnabled( i2p_installed ); } });
public static void restoreDefaultImage(Button button) { Image defaultImage = (Image) button.getData(DEFAULT_IMAGE); if (defaultImage != null) { button.setImage(defaultImage.isDisposed() ? null : defaultImage); } }
protected void updateCheckBox(Button curr) { ControlData data= (ControlData) curr.getData(); String currValue= getValue(data.getKey()); curr.setSelection(data.getSelection(currValue) == 0); }
protected void updateCheckBox(Button curr) { ControlData data= (ControlData) curr.getData(); String currValue= getValue(data.getKey()); curr.setSelection(data.getSelection(currValue) == 0); }
protected void updateCheckBox(Button curr) { ControlData data= (ControlData) curr.getData(); String currValue= getValue(data.getKey()); curr.setSelection(data.getSelection(currValue) == 0); }
@Override public void handleEvent(Event event) { Subscription subscription = (Subscription) addButton.getData("subscription"); if(subscription != null) { subscription.setSubscribed(true); subscription.requestAttention(); shell.close(); } } });