79 lines
1.9 KiB
Java
79 lines
1.9 KiB
Java
package org.gcube.portlets.user.td.client.rule;
|
|
|
|
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
|
import org.gcube.portlets.user.td.expressionwidget.client.RuleDialog;
|
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData;
|
|
|
|
import com.allen_sauer.gwt.log.client.Log;
|
|
import com.google.web.bindery.event.shared.EventBus;
|
|
import com.sencha.gxt.widget.core.client.Window;
|
|
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
|
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
|
|
|
/**
|
|
*
|
|
* @author "Giancarlo Panichi" <a
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
*
|
|
*/
|
|
public class RuleOpenDialog extends Window {
|
|
private static final String WIDTH = "720px";
|
|
private static final String HEIGHT = "530px";
|
|
private EventBus eventBus;
|
|
|
|
public RuleOpenDialog(EventBus eventBus) {
|
|
initWindow();
|
|
this.eventBus=eventBus;
|
|
RuleOpenPanel templateOpenPanel = new RuleOpenPanel(this,
|
|
eventBus);
|
|
add(templateOpenPanel);
|
|
}
|
|
|
|
protected void initWindow() {
|
|
setWidth(WIDTH);
|
|
setHeight(HEIGHT);
|
|
setBodyBorder(false);
|
|
setResizable(false);
|
|
setHeadingText("Open Rule");
|
|
setClosable(true);
|
|
setModal(true);
|
|
forceLayoutOnResize = true;
|
|
getHeader().setIcon(TabularDataResources.INSTANCE.ruleEdit());
|
|
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
@Override
|
|
protected void initTools() {
|
|
super.initTools();
|
|
|
|
closeBtn.addSelectHandler(new SelectHandler() {
|
|
|
|
public void onSelect(SelectEvent event) {
|
|
close();
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
protected void close() {
|
|
hide();
|
|
}
|
|
|
|
public void ruleEdit(RuleDescriptionData ruleDescriptionData) {
|
|
openRuleDialog(ruleDescriptionData);
|
|
|
|
}
|
|
|
|
private void openRuleDialog(RuleDescriptionData ruleDescriptionData) {
|
|
Log.debug("Request Open New Rule Dialog");
|
|
RuleDialog cfDialog = new RuleDialog(ruleDescriptionData,eventBus);
|
|
cfDialog.show();
|
|
|
|
}
|
|
|
|
|
|
}
|