Example usage for java.beans PropertyChangeEvent getNewValue

List of usage examples for java.beans PropertyChangeEvent getNewValue

Introduction

In this page you can find the example usage for java.beans PropertyChangeEvent getNewValue.

Prototype

public Object getNewValue() 

Source Link

Document

Gets the new value for the property, expressed as an Object.

Usage

From source file:org.jboss.tools.openshift.internal.ui.wizard.newapp.fromimage.ApplicationSourceFromImageModel.java

private void handleSelectedAppSource(PropertyChangeEvent evt) {
    if (evt.getNewValue() instanceof ImageStreamApplicationSource
            && ResourceKind.IMAGE_STREAM.equals(((IApplicationSource) evt.getNewValue()).getKind())) {
        this.source = (ImageStreamApplicationSource) evt.getNewValue();
        staleRepoInfo.set(true);//from   w w w  .ja  va 2  s. c  o m
        if (this.eclipseProject == null) {
            setGitRepositoryUrl(null);
            setGitReference(null);
            setContextDir(null);
        }
        setResourceName(null);
    }
}

From source file:org.polymap.core.mapeditor.tooling.edit.LayerEditableDecorator.java

public void propertyChange(PropertyChangeEvent ev) {
    boolean changed = false;

    // edit//from   w  ww  .  j  a  va  2  s  .  c o  m
    if (ev.getSource() instanceof EditTool) {
        ILayer layer = (ILayer) ev.getNewValue();

        if (ev.getPropertyName().equals(EditTool.PROP_LAYER_ACTIVATED)) {
            changed = editableLayerIds.add(layer.id());
        } else if (ev.getPropertyName().equals(EditTool.PROP_LAYER_DEACTIVATED)) {
            changed = editableLayerIds.remove(layer.id());
        }
    }
    // digitize
    else if (ev.getSource() instanceof DigitizeTool) {
        ILayer layer = (ILayer) ev.getNewValue();

        if (ev.getPropertyName().equals(EditTool.PROP_LAYER_ACTIVATED)) {
            changed = digitizableLayerIds.add(layer.id());
        } else if (ev.getPropertyName().equals(EditTool.PROP_LAYER_DEACTIVATED)) {
            changed = digitizableLayerIds.remove(layer.id());
        }
    }

    if (changed) {
        Runnable runnable = new Runnable() {
            public void run() {
                if (!PlatformUI.getWorkbench().isClosing()) {
                    fireLabelProviderChanged(new LabelProviderChangedEvent(LayerEditableDecorator.this));
                }
            }
        };
        if (Display.getCurrent() != null) {
            runnable.run();
        } else {
            Polymap.getSessionDisplay().asyncExec(runnable);
        }
    }
}

From source file:org.jcurl.mr.gui.BroomPanel0.java

public void propertyChange(final PropertyChangeEvent arg0) {
    log.debug(arg0);//w  ww  . j a  v  a 2  s  . c  o  m
    if (model == arg0.getSource())
        if ("broomX".equals(arg0.getPropertyName())) {
            final Measure raw = (Measure) arg0.getNewValue();
            final Measure val;
            if (raw.unit == Unit.NONE)
                val = new Measure(raw.value, dim);
            else
                val = raw.to(dim);
            slider.setValue((int) (val.value * Granularity));
            text.setText(val.toString());
        }
}

From source file:org.pentaho.aggdes.ui.ext.impl.MondrianFileSchemaProvider.java

@Override
public void onLoad() {
    super.onLoad();

    bindingFactory.createBinding("mondrianSelector", "selected", this, "selected");

    bindingFactory.createBinding(this, "selectedEnabled", "mondrianSchemaFileName", "!disabled");
    bindingFactory.createBinding(this, "selectedEnabled", "fileSelector", "!disabled");
    bindingFactory.createBinding(this, "mondrianSchemaFilename", "mondrianSchemaFileName", "value");
    bindingFactory.setBindingType(Binding.Type.ONE_WAY);
    bindingFactory.createBinding(this, "enabled", "mondrianSelector", "!disabled");

    addPropertyChangeListener("mondrianSchemaFilename", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            String val = (String) evt.getNewValue();
            setSchemaDefined(!StringUtils.isEmpty(val));
        }//from ww  w. j a v a 2  s .co m
    });

    BindingConvertor<Boolean, Boolean> isDefinedConverter = new BindingConvertor<Boolean, Boolean>() {

        @Override
        public Boolean sourceToTarget(Boolean value) {
            if (Boolean.TRUE.equals(value)) {
                return !StringUtils.isEmpty(getMondrianSchemaFilename());
            }
            return false;
        }

        @Override
        public Boolean targetToSource(Boolean value) {
            return null;
        }
    };

    bindingFactory.setBindingType(Binding.Type.ONE_WAY);
    bindingFactory.createBinding(this, "selected", this, "schemaDefined", isDefinedConverter);

    // special binding based on type of database meta
    BindingConvertor<Boolean, Boolean> converter = new BindingConvertor<Boolean, Boolean>() {
        @Override
        public Boolean sourceToTarget(Boolean value) {
            DatabaseMeta databaseMeta = connectionModel.getDatabaseMeta();
            boolean disabled = connectionModel.isSchemaLocked();

            if (disabled && isSelected()) {
                setSelected(false);
            }
            return disabled;
        }

        @Override
        public Boolean targetToSource(Boolean value) {
            // TODO Auto-generated method stub
            return null;
        }
    };
    bindingFactory.createBinding(connectionModel, "schemaSourceSelectionEnabled", "mondrianSelector",
            "disabled", converter);

}

From source file:org.kepler.monitor.FigureUpdater.java

public void propertyChange(PropertyChangeEvent evt) {
    String propName = evt.getPropertyName();
    Object newValue = evt.getNewValue();
    if (isDebugging) {
        log.debug(propName + " -> " + newValue);
    }//from  w  w w.  jav a  2s .c o m

    if (_figure instanceof StateFigure) {
        StateFigure fig = (StateFigure) _figure;
        if (State.STATE.equals(propName)) {
            Object state = newValue;
            fig.setState(state);
            fig.update();
        }
    } else if (_figure instanceof QualityFigure) {
        QualityFigure fig = (QualityFigure) _figure;

        /** Check states and assign appropriate quality values*/
        if (State.HIGH_QUALITY.equals(propName)) {
            fig.setHighQualityThreshold(newValue);
        } else if (State.LOW_QUALITY.equals(propName)) {
            fig.setLowQualityThreshold(newValue);
        }

        /** If state being passed is quality score, then update quality figure*/
        else if (State.QUALITY_SCORE.equals(propName)) {
            fig.update2(newValue);
        }
    } else if (_figure instanceof ProgressBarFigure) {
        ProgressBarFigure fig = (ProgressBarFigure) _figure;

        // TODO: the current value for the bar should be taken from the
        // property?
        // ..

        fig.update();
    } else if (_figure instanceof LabelFigure) {
        if (isDebugging) {
            log.debug("updating LabelFigure: _propNameForLabel=" + _propNameForLabel);
        }
        LabelFigure fig = (LabelFigure) _figure;
        if (propName.equals(_propNameForLabel)) {
            fig.setString(String.valueOf(newValue));
        }
    }
}

From source file:org.nbheaven.sqe.codedefects.dashboard.controlcenter.panels.Statistics.java

public void propertyChange(PropertyChangeEvent evt) {
    if (SQEManager.PROP_ACTIVE_PROJECT.equals(evt.getPropertyName())) {
        setActiveProject((Project) evt.getNewValue());
    }//from  ww  w . ja v a 2s  . c  o m
    updateView();
}

From source file:wsattacker.sso.openid.attacker.server.OpenIdServer.java

@Override
public void propertyChange(PropertyChangeEvent pce) {
    String propertyName = pce.getPropertyName();
    Object newValue = pce.getNewValue();
    Object oldValue = pce.getOldValue();
    switch (propertyName) {
    case OpenIdServerConfiguration.PROP_HTMLCONFIGURATION:
        HtmlDiscoveryConfiguration oldHtmlConfig = (HtmlDiscoveryConfiguration) oldValue;
        HtmlDiscoveryConfiguration newHtmlConfig = (HtmlDiscoveryConfiguration) newValue;
        LOG.info("Changed HTML Discovery Configuration");
        oldHtmlConfig.removePropertyChangeListener(this);
        newHtmlConfig.addPropertyChangeListener(this);
        processor.setHtmlConfiguration(newHtmlConfig);
        break;/*from  w  ww . j  ava2 s  .c  om*/
    case OpenIdServerConfiguration.PROP_XRDSCONFIGURATION:
        XrdsConfiguration oldConfig = (XrdsConfiguration) oldValue;
        XrdsConfiguration newConfig = (XrdsConfiguration) newValue;
        LOG.info("Changed XRDS Configuration");
        oldConfig.removePropertyChangeListener(this);
        newConfig.addPropertyChangeListener(this);
        processor.setXrdsConfiguration(newConfig);
        processor.setEndpoint(newConfig.getBaseUrl());
        break;
    case XrdsConfiguration.PROP_BASEURL:
        LOG.info(String.format("Changed Endpoint URI from '%s' to '%s'", oldValue, newValue));
        processor.setEndpoint((String) pce.getNewValue());
        break;
    case OpenIdServerConfiguration.PROP_ASSOCIATIONEXPIRATIONINSECONDS:
        LOG.info(String.format("Changed Association expiration time from %ss to %ss", oldValue, newValue));
        processor.setExpiresIn((int) pce.getNewValue());
        break;
    case OpenIdServerConfiguration.PROP_VALIDUSER:
        LOG.info("Changed valid user!");
        processor.setValidUser((User) newValue);
        break;
    case OpenIdServerConfiguration.PROP_ASSOCIATIONPREFIX:
        LOG.info(String.format("Association Prefix changed from '%s' to '%s'", oldValue, newValue));
        store.setAssociationPrefix((String) newValue);
        break;
    default:
        break;
    }
}

From source file:org.jtrfp.trcl.flow.GameShell.java

public GameShell(TR tr) {
    this.tr = tr;
    tr.addPropertyChangeListener(TR.GAME, new PropertyChangeListener() {
        @Override//  www. j  a v a2  s .c om
        public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getNewValue() == null) {
                earlyLoadingScreen.setStatusText("No game loaded.");
                showGameshellScreen();
            } else {
                hideGameshellScreen();
            }
        }
    });
}

From source file:com.sec.ose.osi.thread.job.analysis.AnalysisMonitorThread.java

private void startAnalysis() {

    setStatus(STATUS_EXECUTING);//from w  w  w  .  ja  va 2 s  .  c  om
    log.debug("AnalysisMonitorThread STATUS : " + getStatus());

    ManageMediator.getInstance().updateUIForStartAnalysis();
    ManageMediator.getInstance().setStatusText("analyzing...");

    mAnalyzeTask = new AnalyzeExecutionThread(ManageMediator.getInstance().getAnalysisProjects(),
            ManageMediator.getInstance());

    mAnalyzeTask.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            if ("progress".equals(evt.getPropertyName())) {
                ManageMediator.getInstance().setProgressValue((Integer) evt.getNewValue());
            }
        }
    });

    mAnalyzeTask.execute();
}

From source file:wsattacker.plugin.intelligentdos.option.SchemaAnalyzerOption.java

@Override
public void propertyChange(PropertyChangeEvent evt) {
    final String propName = evt.getPropertyName();
    String create = DEFAULT_SOAP_MESSAGE;

    if (CurrentRequest.PROP_WSDLREQUEST.equals(propName)) {

        if (evt.getNewValue() != null) {
            WsdlRequest newRequest = (WsdlRequest) evt.getNewValue();
            create = create(newRequest.getRequestContent());
        }//from  w  w  w  .  j  av  a 2s. c  o  m

    } else if (CurrentRequest.PROP_WSDLREQUESTCONTENT.equals(propName)) {
        if (evt.getNewValue() != null) {
            String newContent = (String) evt.getNewValue();
            create = create(newContent);
        }
    } else if (CurrentRequest.PROP_WSDLRESPONSE.equals(propName)
            || CurrentRequest.PROP_WSDLRESPONSECONTENT.equals(propName)) {
        // nothing to do
        return;
    }

    setValue(create);

}