"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "openmeetings-web/src/main/java/org/apache/openmeetings/web/common/confirmation/ConfirmationBehavior.java" between
apache-openmeetings-6.1.0-src.tar.gz and apache-openmeetings-6.2.0-src.tar.gz

About: OpenMeetings is a browser-based software that allows you to set up instantly a conference in the Web. You can use your microphone or webcam, share documents on a white board, share your screen or record meetings. Source code.

ConfirmationBehavior.java  (apache-openmeetings-6.1.0-src):ConfirmationBehavior.java  (apache-openmeetings-6.2.0-src)
skipping to change at line 21 skipping to change at line 21
* *
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.openmeetings.web.common.confirmation; package org.apache.openmeetings.web.common.confirmation;
import static de.agilecoders.wicket.jquery.JQuery.$;
import org.apache.wicket.Component; import org.apache.wicket.Component;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.resource.JQueryPluginResourceReference;
import org.apache.wicket.util.lang.Args;
import de.agilecoders.wicket.core.markup.html.bootstrap.behavior.BootstrapJavasc
riptBehavior;
import de.agilecoders.wicket.core.util.References;
/**
* A behavior that shows a popover with OK/Cancel buttons to confirm an action.
*
* @since 0.9.12
*/
public class ConfirmationBehavior extends BootstrapJavascriptBehavior {
/** serialVersionUID. */
private static final long serialVersionUID = 1L;
/** Configuration. */
private final ConfirmationConfig config;
/**
* Jquery Selector (if you don't want to use the one of the component for
* singleton for example).
*/
private final String selector;
/**
* Constructor that uses the default configuration
*/
public ConfirmationBehavior() {
this(null, new ConfirmationConfig());
}
/** import de.agilecoders.wicket.extensions.markup.html.bootstrap.confirmation.Confi
* Constructor that uses a custom configuration rmationBehavior;
* import de.agilecoders.wicket.extensions.markup.html.bootstrap.confirmation.Confi
* @param config rmationConfig;
* configuration to use
*/
public ConfirmationBehavior(ConfirmationConfig config) {
this(null, config);
}
/**
* Constructor that uses a custom configuration
*
* @param config
* configuration to use
* @param selector
* Jquery selector to use instead of the one of the component
* (for singleton's option)
*/
public ConfirmationBehavior(String selector, ConfirmationConfig config) {
this.config = Args.notNull(config, "config");
this.selector = selector;
}
@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
References.renderWithFilter(response, JavaScriptHeaderItem
.forReference(new JQueryPluginResourceReference(C
onfirmationBehavior.class, "bootstrap-confirmation.js")));
if (selector == null) {
config.withRootSelector(component.getMarkupId());
response.render($(component).chain("confirmation", config
).asDomReadyScript());
} else {
config.withRootSelector(selector);
response.render($(selector).chain("confirmation", config)
.asDomReadyScript());
}
}
public class ConfirmationHelper {
public static ConfirmationBehavior newOkCancelConfirm(Component c, String title) { public static ConfirmationBehavior newOkCancelConfirm(Component c, String title) {
return new ConfirmationBehavior(newOkCancelConfirmCfg(c, title)); return new ConfirmationBehavior(newOkCancelConfirmCfg(c, title));
} }
public static ConfirmationConfig newOkCancelConfirmCfg(Component c, Strin g title) { public static ConfirmationConfig newOkCancelConfirmCfg(Component c, Strin g title) {
return new ConfirmationConfig() return new ConfirmationConfig()
.withBtnCancelLabel(c.getString("lbl.cancel")) .withBtnCancelLabel(c.getString("lbl.cancel"))
.withBtnOkLabel(c.getString("54")) .withBtnOkLabel(c.getString("54"))
.withTitle(title); .withTitle(title);
} }
 End of changes. 4 change blocks. 
75 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)