當前位置: 首頁>>代碼示例>>Java>>正文


Java PropertyChangeEvent.getOldValue方法代碼示例

本文整理匯總了Java中org.eclipse.jface.util.PropertyChangeEvent.getOldValue方法的典型用法代碼示例。如果您正苦於以下問題:Java PropertyChangeEvent.getOldValue方法的具體用法?Java PropertyChangeEvent.getOldValue怎麽用?Java PropertyChangeEvent.getOldValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.util.PropertyChangeEvent的用法示例。


在下文中一共展示了PropertyChangeEvent.getOldValue方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getStrategy

import org.eclipse.jface.util.PropertyChangeEvent; //導入方法依賴的package包/類
/**
 * Returns with the strategy for the given property change even argument,
 *
 * @param event
 *            a property change argument.
 * @return a strategy encapsulating an actual working set manager modification.
 */
public WorkingSetManagerModificationStrategy getStrategy(final PropertyChangeEvent event) {

    if (event == null) {
        return NOOP;
    }

    final String property = event.getProperty();
    switch (property) {
    case CHANGE_WORKING_SET_ADD:
        return new AddWorkingSetModificationStrategy((IWorkingSet) event.getNewValue());
    case CHANGE_WORKING_SET_REMOVE:
        return new RemoveWorkingSetModificationStrategy((IWorkingSet) event.getOldValue());
    case CHANGE_WORKING_SET_LABEL_CHANGE: //$FALL-THROUGH$
    case CHANGE_WORKING_SET_NAME_CHANGE: //$FALL-THROUGH$
    case CHANGE_WORKING_SET_CONTENT_CHANGE:
        return new UpdateWorkingSetModificationStraregy(
                (IWorkingSet) event.getOldValue(),
                (IWorkingSet) event.getNewValue());
    default:
        return NOOP;
    }
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:30,代碼來源:WorkingSetManagerModificationStrategyProvider.java

示例2: propertyChange

import org.eclipse.jface.util.PropertyChangeEvent; //導入方法依賴的package包/類
@Override
public void propertyChange(PropertyChangeEvent event) {
    if (!key.equals(event.getProperty())) {
        return;
    }

    Object oldValuePlain = event.getOldValue();
    Object newValuePlain = event.getNewValue();
    if (!isValid(oldValuePlain) || !isValid(newValuePlain)) {
        return;
    }

    Object source = event.getSource();
    if (!(source instanceof IWorkbenchPart)) {
        return;
    }

    handleChange((IWorkbenchPart) source, (String) oldValuePlain, (String) newValuePlain);
}
 
開發者ID:Cooperate-Project,項目名稱:CooperateModelingEnvironment,代碼行數:20,代碼來源:PropertyChangeHandlerBase.java

示例3: addPropertyChangeListener

import org.eclipse.jface.util.PropertyChangeEvent; //導入方法依賴的package包/類
protected void addPropertyChangeListener() {
    propertyChangeListener = new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            if (getPreferenceKey().equals(event.getProperty()) && event.getOldValue() != event.getNewValue()) {
                boolean newValue = Boolean.parseBoolean(event.getNewValue().toString());
                stateChanged(newValue);
                getAction().setChecked(newValue);
            }
        }
    };
    preferenceStore = preferenceStoreAccess.getPreferenceStore();
    preferenceStore.addPropertyChangeListener(propertyChangeListener);
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:14,代碼來源:AbstractToggleActionContributor.java

示例4: propertyChange

import org.eclipse.jface.util.PropertyChangeEvent; //導入方法依賴的package包/類
@Override
public void propertyChange(final PropertyChangeEvent event) {

    final String eventProperty = event.getProperty();

    if (eventProperty.equals(FieldEditor.VALUE)) {

        _isModified = true;

        if (event.getSource() == _editorTourPaintMethod) {

            // display info for the selected paint method
            final String newValue = (String) event.getNewValue();
            final String oldValue = (String) event.getOldValue();

            if (oldValue.equals(TOUR_PAINT_METHOD_SIMPLE)
                    && newValue.equals(TOUR_PAINT_METHOD_COMPLEX)
                    && net.tourbook.common.UI.IS_OSX) {

                MessageDialog.openWarning(
                        getShell(),
                        Messages.Pref_MapLayout_Dialog_OSX_Warning_Title,
                        Messages.Pref_MapLayout_Dialog_OSX_Warning_Message);
            }

            setUIPaintMethodInfo(newValue);
        }

        enableControls();
    }

    super.propertyChange(event);

    if (_chkLiveUpdate.getSelection()) {
        performApply();
    }
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:38,代碼來源:PrefPageMap2Appearance.java

示例5: onSelectColorInColorSelector

import org.eclipse.jface.util.PropertyChangeEvent; //導入方法依賴的package包/類
/**
 * is called when the color in the color selector has changed
 * 
 * @param event
 */
private void onSelectColorInColorSelector(final PropertyChangeEvent event) {

    final RGB oldValue = (RGB) event.getOldValue();
    final RGB newValue = (RGB) event.getNewValue();

    if (!oldValue.equals(newValue) && _selectedColor != null) {

        // color has changed

        // update the data model
        _selectedColor.setRGB(newValue);

        /*
         * dispose the old color/image from the graph
         */
        _graphColorPainter.invalidateResources(//
                _selectedColor.getColorId(),
                _selectedColor.getColorDefinition().getColorDefinitionId());

        /*
         * update the tree viewer, the color images will then be recreated
         */
        _colorViewer.update(_selectedColor, null);
        _colorViewer.update(_selectedColor.getColorDefinition(), null);

        _isColorChanged = true;
    }
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:34,代碼來源:PrefPageAppearanceColors.java

示例6: onChangeGraphColor

import org.eclipse.jface.util.PropertyChangeEvent; //導入方法依賴的package包/類
/**
 * Is called when the color in the color selector has changed
 * 
 * @param event
 */
private void onChangeGraphColor(final PropertyChangeEvent event) {

    final RGB oldRGB = (RGB) event.getOldValue();
    final RGB newRGB = (RGB) event.getNewValue();

    if (_selectedGraphColor == null || oldRGB.equals(newRGB)) {
        return;
    }

    // color has changed

    // update model
    _selectedGraphColor.setRGB(newRGB);

    final TourTypeColorDefinition selectedColorDefinition = (TourTypeColorDefinition) _selectedGraphColor
            .getColorDefinition();

    /*
     * update tour type in the db
     */
    final TourType oldTourType = selectedColorDefinition.getTourType();

    oldTourType.setColorBright(selectedColorDefinition.getGradientBright_New());
    oldTourType.setColorDark(selectedColorDefinition.getGradientDark_New());
    oldTourType.setColorLine(selectedColorDefinition.getLineColor_New());
    oldTourType.setColorText(selectedColorDefinition.getTextColor_New());

    final TourType savedTourType = saveTourType(oldTourType);

    selectedColorDefinition.setTourType(savedTourType);

    // replace tour type with new one
    _dbTourTypes.remove(oldTourType);
    _dbTourTypes.add(savedTourType);
    Collections.sort(_dbTourTypes);

    /*
     * Update UI
     */
    // invalidate old color/image from the graph and color definition to force the recreation
    _graphColorPainter.invalidateResources(//
            _selectedGraphColor.getColorId(),
            selectedColorDefinition.getColorDefinitionId());

    // update UI
    TourTypeImage.setTourTypeImagesDirty();

    /*
     * update the tree viewer, the color images will be recreated in the label provider
     */
    _tourTypeViewer.update(_selectedGraphColor, null);
    _tourTypeViewer.update(selectedColorDefinition, null);

    // without a repaint the color def image is not updated
    _tourTypeViewer.getTree().redraw();

    _isModified = true;
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:64,代碼來源:PrefPageTourTypes.java


注:本文中的org.eclipse.jface.util.PropertyChangeEvent.getOldValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。