Modeler Reengineer dialog improvement\nSelect newly created data source
Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/374fa272 Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/374fa272 Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/374fa272 Branch: refs/heads/master Commit: 374fa272b7fbc52abc4e4a41fe5be9f1a44fc83c Parents: 55f7a23 Author: Nikita Timofeev <[email protected]> Authored: Tue Nov 1 12:32:35 2016 +0300 Committer: Savva Kolbachev <[email protected]> Committed: Thu Nov 3 22:54:28 2016 +0300 ---------------------------------------------------------------------- .../event/DataSourceModificationEvent.java | 42 ++++++++++++++++++++ .../event/DataSourceModificationListener.java | 36 +++++++++++++++++ 2 files changed, 78 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cayenne/blob/374fa272/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataSourceModificationEvent.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataSourceModificationEvent.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataSourceModificationEvent.java new file mode 100644 index 0000000..1dd4e64 --- /dev/null +++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataSourceModificationEvent.java @@ -0,0 +1,42 @@ +/***************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + ****************************************************************/ + +package org.apache.cayenne.modeler.event; + +import org.apache.cayenne.map.event.MapEvent; + +public class DataSourceModificationEvent extends MapEvent { + + private final String dataSourceName; + + public DataSourceModificationEvent(Object source, String dataSourceName, int id) { + super(source); + this.dataSourceName = dataSourceName; + setId(id); + } + + public String getDataSourceName() { + return dataSourceName; + } + + @Override + public String getNewName() { + return dataSourceName; + } +} http://git-wip-us.apache.org/repos/asf/cayenne/blob/374fa272/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataSourceModificationListener.java ---------------------------------------------------------------------- diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataSourceModificationListener.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataSourceModificationListener.java new file mode 100644 index 0000000..0b7d0f6 --- /dev/null +++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/DataSourceModificationListener.java @@ -0,0 +1,36 @@ +/***************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + ****************************************************************/ + +package org.apache.cayenne.modeler.event; + +import java.util.EventListener; + +/** + * Data Source modification listener + */ +public interface DataSourceModificationListener extends EventListener { + + //TODO change events not supported for now + //void callbackDataSourceChanged(DataSourceModificationEvent e); + + void callbackDataSourceAdded(DataSourceModificationEvent e); + + void callbackDataSourceRemoved(DataSourceModificationEvent e); + +}
