com.smartgwt.client.widgets.events.ClickEvent Java Examples

The following examples show how to use com.smartgwt.client.widgets.events.ClickEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BrandingPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void initGUI() {
	tenantBranding = new TenantBrandingPanel(tenant, new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {

		}
	});

	IButton save = new IButton(I18N.message("save"));
	save.setMinWidth(80);
	save.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			if (tenantBranding.validate())
				onSave();
		}
	});

	body.setMembers(tenantBranding);
	addMember(save);
}
 
Example #2
Source File: OwnRulesListGrid.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createDeleteRuleButtonm(final ListGridRecord ruleRecord) {
    IButton deleteButton = new IButton(i18n.delete());
    deleteButton.setShowDown(false);
    deleteButton.setShowRollOver(false);
    deleteButton.setLayoutAlign(Alignment.CENTER);
    deleteButton.setPrompt(i18n.deleteThisRule());
    deleteButton.setHeight(16);
    deleteButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            SC.ask(i18n.reallyDeleteRule(), new BooleanCallback() {
                public void execute(Boolean value) {
                    if (value) {
                        String uuid = ruleRecord.getAttribute(UUID);
                        String userRole = getLoggedInUserRole();
                        EventBus.getMainEventBus().fireEvent(new DeleteRuleEvent(currentSession(), uuid, userRole));
                    }
                }
            });
        }
    });
    return deleteButton;
}
 
Example #3
Source File: OwnRulesListGrid.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createPublishRuleButton(final ListGridRecord ruleRecord) {
    IButton publishButton = new IButton(i18n.publishButton());
    publishButton.setShowDown(false);
    publishButton.setShowRollOver(false);
    publishButton.setLayoutAlign(Alignment.CENTER);
    publishButton.setHeight(16);
    publishButton.setAutoFit(true);

    final boolean published = ruleRecord.getAttributeAsBoolean(PUBLISHED);
    if (published) {
        publishButton.setTitle(i18n.unpublishButton());
        publishButton.setPrompt(i18n.cancelPublication());
    } else {
        publishButton.setTitle(i18n.publishButton());
        publishButton.setPrompt(i18n.publishThisRule());
    }

    publishButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            String ruleName = ruleRecord.getAttribute(NAME);
            EventBus.getMainEventBus().fireEvent(new PublishRuleEvent(currentSession(), ruleName, !published, "USER"));
        }
    });

    return publishButton;
}
 
Example #4
Source File: UserCalendarPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void onDraw() {
	ToolStrip toolStrip = new ToolStrip();
	toolStrip.setHeight(20);
	toolStrip.setWidth100();
	toolStrip.addSpacer(2);

	ToolStripButton refresh = new ToolStripButton();
	refresh.setTitle(I18N.message("refresh"));
	toolStrip.addButton(refresh);
	refresh.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			refresh();
		}
	});
	toolStrip.addFill();
	addMember(toolStrip);

	initCalendar();
}
 
Example #5
Source File: OwnRulesListGrid.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createEditRuleButton(final ListGridRecord ruleRecord) {
    // subscribe button
    IButton editButton = new IButton(i18n.edit());
    editButton.setShowDown(false);
    editButton.setShowRollOver(false);
    editButton.setLayoutAlign(Alignment.CENTER);
    editButton.setPrompt(i18n.editThisRule());
    editButton.setHeight(16);
    editButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            String name = ruleRecord.getAttribute(NAME);
            EventBus.getMainEventBus().fireEvent(new GetAllPublishedRulesEvent(currentSession(), 1));
            EventBus.getMainEventBus().fireEvent(new EditRuleEvent(name));
        }
    });

    return editButton;
}
 
Example #6
Source File: StationSelector.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createSelectionMenuButton() {
   	showSelectionMenuButton = new Label(i18n.chooseDataSource());
   	showSelectionMenuButton.setStyleName("n52_sensorweb_client_legendbuttonPrimary");
   	showSelectionMenuButton.setZIndex(1000000);
   	showSelectionMenuButton.setAutoHeight();
   	showSelectionMenuButton.setAutoWidth();
   	showSelectionMenuButton.setWrap(false);
   	showSelectionMenuButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			if (selectionMenu.isVisible()) {
				selectionMenu.animateHide(AnimationEffect.SLIDE);
			} else {
				selectionMenu.animateShow(AnimationEffect.SLIDE);
			}
		}
	});
   	setSelectionMenuButtonPosition();
	return showSelectionMenuButton;
}
 
Example #7
Source File: DataControlsTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createAutoScaleButton() {
	Layout layout = new Layout();
	layout.setStyleName("n52_sensorweb_client_scaleButtonLayout");
	autoScaleButton = new Label(i18n.resetScale());
	autoScaleButton.setStyleName("n52_sensorweb_client_scaleButton");
    autoScaleButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            EventBus.getMainEventBus().fireEvent(new SwitchAutoscaleEvent(true), new EventCallback() {
                public void onEventFired() {
                    EventBus.getMainEventBus().fireEvent(new RequestDataEvent());
                }
            });
        }
    });
    autoScaleButton.setWidth(80);
    autoScaleButton.setWrap(false);
    return autoScaleButton;
}
 
Example #8
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Label getImprintLink() {
	Label imprint = getHeaderLinkLabel(i18n.Impressum());
       imprint.addClickHandler(new ClickHandler() {
           public void onClick(ClickEvent event) {
               com.smartgwt.client.widgets.Window w = new com.smartgwt.client.widgets.Window();
               w.setTitle(i18n.Impressum());
               w.setWidth(450);
               w.setHeight(460);
               w.centerInPage();
               w.setIsModal(true);

               VLayout layout = new VLayout();
               HTMLPane pane = new HTMLPane();
               pane.setContentsURL(i18n.imprintPath());
               layout.setStyleName("n52_sensorweb_client_imprint_content");
               layout.addMember(pane);
               w.addItem(layout);
               w.show();
           }
       });
	return imprint;
}
 
Example #9
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private ImageButton createCSVExportButton() {
	ImageButton exportCSV = new ImageButton(
			"exportCSV", "../img/icons/table.png", //$NON-NLS-2$
			i18n.exportCSV(), i18n.exportCSVExtended());
	View.getView().registerTooltip(exportCSV);
	exportCSV.addClickHandler(new ClickHandler() {

		public void onClick(ClickEvent event) {
			List<TimeseriesLegendData> series = new ArrayList<TimeseriesLegendData>();
			series.add(getTimeSeries());
			EventBus.getMainEventBus().fireEvent(
					new ExportEvent(series, ExportEvent.ExportType.CSV));

		}
	});
	return exportCSV;
}
 
Example #10
Source File: Legend.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Label createPDFLabel() {
    Label toPDF = new Label(i18n.toPDF());
    toPDF.setWrap(false);
    toPDF.setAutoFit(true);
    toPDF.setPadding(3);
    toPDF.setWidth100();
    toPDF.setStyleName("n52_sensorweb_client_exportEntry");
    toPDF.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            controller.exportTo(ExportType.PDF_ALL_IN_ONE);
            exportMenu.hide();
        }
    });
    return toPDF;
}
 
Example #11
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Label getCopyrightLink() {

        DateTimeFormat dateFormatter = DateTimeFormat.getFormat("yyyy");
		String year = dateFormatter.format(new Date());

        Label copyright = getHeaderLinkLabel("&copy; 52&#176;North, GmbH " + year);
        copyright.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				String url = "http://www.52north.org";
                Window.open(url, "_blank", "");
			}
		});
		return copyright;
	}
 
Example #12
Source File: AllRulesListGrid.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
protected Canvas createEditRuleButton(final ListGridRecord ruleRecord) {
    String userID = getLoggedInUser();
    String ruleOwnerID = ruleRecord.getAttribute(OWNERID);
    if (ruleOwnerID.equals(userID)) {
        IButton editButton = new IButton(i18n.edit());
        editButton.setShowDown(false);
        editButton.setShowRollOver(false);
        editButton.setLayoutAlign(Alignment.CENTER);
        editButton.setPrompt(i18n.editThisRule());
        editButton.setHeight(16);
        editButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                String name = ruleRecord.getAttribute(NAME);
                EventBus.getMainEventBus().fireEvent(new EditRuleEvent(name));
            }
        });
        return editButton;
    } else {
        return null;
    }
}
 
Example #13
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private void createDeleteLegendEntryButton() {
	this.deleteButton = new SmallButton(new Img("../img/icons/del.png"),
			i18n.delete(), i18n.deleteExtended());
	this.deleteButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent evt) {
			if (SOSController.isDeletingTS) {
				Toaster.getToasterInstance().addMessage(i18n.deleteTimeSeriesActiv());
			} else {
				SOSController.isDeletingTS = true;
				LegendEntryTimeSeries.this.getEventBroker().unregister();
				EventBus.getMainEventBus().fireEvent(
						new DeleteTimeSeriesEvent(LegendEntryTimeSeries.this
								.getElemId()));
			}
		}
	});
}
 
Example #14
Source File: SubscriptionListGrid.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
protected ClickHandler createDeleteHandler(final ListGridRecord ruleRecord) {
    return new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            boolean subscribed = ruleRecord.getAttributeAsBoolean(SUBSCRIBED).booleanValue();
            if (subscribed) {
                SC.say(i18n.deleteOnlyWhenUnsubbscribed());
            } else {
                SC.ask(i18n.deleteSubscriptionQuestion(), new BooleanCallback() {
                    @Override
                    public void execute(Boolean value) {
                        if (value) {
                            String role = getLoggedInUserRole();
                            String uuid = ruleRecord.getAttribute(UUID);
                            getMainEventBus().fireEvent(new DeleteRuleEvent(currentSession(), uuid, role));
                            removeData(ruleRecord);
                        }
                    }
                });
            }
        }
    };
}
 
Example #15
Source File: EventPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private EventPanel() {
	setHeight(20);
	setWidth100();
	setAlign(Alignment.LEFT);
	setMargin(2);
	setMembersMargin(2);

	ToolStripButton log = AwesomeFactory.newIconButton("clipboard-list", "lastevents");
	log.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			EventsWindow.get().show();
			if (statusLabel != null)
				statusLabel.setContents("");
		}
	});

	addMember(log);
}
 
Example #16
Source File: Legend.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Label createExportLabelButton() {
    Label export = new Label(i18n.export());
    export.setStyleName("n52_sensorweb_client_legendbuttonDisabled");
    export.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (exportMenu.isVisible()) {
                exportMenu.hide();
            }
            else {
                exportMenu.setLeft(exportButton.getAbsoluteLeft() - 2);
                exportMenu.setWidth(exportButton.getWidth());
                exportMenu.show();
            }
        }
    });
    return export;
}
 
Example #17
Source File: MessageLabel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public MessageLabel(final GUIMessage message, boolean showLinks) {
	if (message.getUrl() == null || message.getUrl().isEmpty() || !showLinks)
		setContents("<span>" + message.getMessage() + "</span>");
	else
		setContents("<span style='text-decoration: underline'>" + message.getMessage() + "</span>");
	setHeight(25);
	setWrap(true);
	if (message.getPriority() == GUIMessage.PRIO_INFO)
		setIcon("[SKIN]/Dialog/notify.png");
	else if (message.getPriority() == GUIMessage.PRIO_WARN)
		setIcon("[SKIN]/Dialog/warn.png");
	if (showLinks && message.getUrl() != null && !message.getUrl().isEmpty()) {
		setCursor(Cursor.HAND);
		addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				Window.open(message.getUrl(), "_self", "");
			}
		});
	}
}
 
Example #18
Source File: PreviewPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void showReloadPanel() {
	IButton reloadButton = new IButton(I18N.message("reload"));
	reloadButton.setAutoFit(true);
	reloadButton.setSnapTo("C");
	reloadButton.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			redraw();
		}
	});

	reload = new Canvas();
	reload.setWidth100();
	reload.setHeight100();
	reload.setAlign(Alignment.CENTER);
	reload.addChild(reloadButton);

	addMember(reload);
}
 
Example #19
Source File: TreeExpandAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void performAction(ActionEvent event) {
    Record[] records = Actions.getSelection(event);

    if (records.length == 0) {
        return;
    }

    optionsForm = createExpandOptionsForm();

    final Dialog d = new Dialog(i18n.TreeExpandAction_Window_Title());
    d.getDialogLabelContainer().setContents(i18n.TreeExpandAction_Window_Msg());
    d.getDialogContentContainer().setMembers(optionsForm);
    d.addYesButton((ClickEvent eventX) -> {
        d.destroy();
        String pid = records[0].getAttribute(RelationDataSource.FIELD_PID);
        treeView.expandNode(pid);
    });
    d.addNoButton(() -> {
        d.destroy();
    });
    d.setWidth(400);
    d.show();
}
 
Example #20
Source File: Actions.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public static ToolStripButton asToolStripButton(final Action action, final Object source) {
    ToolStripButton tsb = new ToolStripButton();
    String title = action.getTitle();
    if (title != null) {
        tsb.setTitle(title);
    }
    String icon = action.getIcon();
    if (icon != null) {
        tsb.setIcon(icon);
    }
    String tooltip = action.getTooltip();
    if (tooltip != null) {
        tsb.setTooltip(tooltip);
    }
    tsb.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            ActionEvent aEvent = new ActionEvent(source);
            action.performAction(aEvent);
        }
    });
    return tsb;
}
 
Example #21
Source File: GUIGridsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void onDraw() {
	ToolStrip toolbar = new ToolStrip();
	toolbar.setWidth100();
	ToolStripButton save = new ToolStripButton(I18N.message("save"));
	save.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			onSave();
		}
	});
	toolbar.addButton(save);

	SectionStack documentsStack = prepareDocumentsGrid();
	SectionStack searchStack = prepareSearchGrid();
	
	HLayout body = new HLayout();
	body.setMembersMargin(3);
	body.setWidth100();
	body.setHeight100();
	body.setMembers(documentsStack, searchStack);

	setMembers(toolbar, body);
}
 
Example #22
Source File: ExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
protected final void dsAddData(DataSource dataSource, Record record, DSCallback dsCallback, DSRequest dsRequest) {
    DynamicForm optionsForm = createOptionsForm();

    if (optionsForm == null) {
        dataSource.addData(record, dsCallback, dsRequest);
        SC.say(i18n.ExportAction_Sent_Msg());
        return;
    }

    Dialog d = new Dialog(i18n.ExportAction_Request_Title());
    d.getDialogContentContainer().addMember(optionsForm);

    IButton okButton = d.addOkButton((ClickEvent eventX) -> {
        setRequestOptions(record);
        dataSource.addData(record, dsCallback, dsRequest);
        d.destroy();
        SC.say(i18n.ExportAction_Sent_Msg());
    });

    d.addCancelButton(() -> d.destroy());
    d.setWidth(400);
    d.show();

    okButton.focus();
}
 
Example #23
Source File: LoginWindow.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private Canvas createButtons() {
    IButton btnSubmit = new IButton(i18nSgwt.dialog_LoginButtonTitle(), new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            submitCredentials();
        }
    });

    HStack btnLayout = new HStack(5);
    btnLayout.setAutoHeight();
    btnLayout.setLayoutTopMargin(20);
    btnLayout.setLayoutAlign(Alignment.CENTER);
    btnLayout.setMembers(btnSubmit);
    return btnLayout;
}
 
Example #24
Source File: EventSubscriptionWindow.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private ClickHandler createApplyHandler() {
    return new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (controller.isSelectionValid()) {
                Rule rule = controller.createSimpleRuleFromSelection();
                CreateSimpleRuleEvent createEvt = new CreateSimpleRuleEvent(currentSession(), rule, false, "");
                EventBus.getMainEventBus().fireEvent(createEvt); // broker handles auto-subscribe
                EventSubscriptionWindow.this.hide();
            } else {
                // form validation should render error message
                // TODO form error handling does not work yet
            	SC.warn(i18n.validateTextBoxes());
            }
        }
    };
}
 
Example #25
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ImageButton createJumpToLastValueButton() {
	final ImageButton jumpLast = new ImageButton("jumpLast",
			"../img/icons/control_end_blue.png",
			i18n.jumpToLast(),
			i18n.jumpToLastExtended());
	View.getView().registerTooltip(jumpLast);
	jumpLast.addClickHandler(new ClickHandler() {

		public void onClick(ClickEvent event) {
			long date = LegendEntryTimeSeries.this.getTimeSeries()
					.getLastValueDate();
			if (date == 0) {
				Toaster.getToasterInstance().addMessage(
						i18n.errorSOS() + ": "
								+ i18n.jumpToLast());
				return;
			}
			long interval = TimeManager.getInst().getEnd() - date;

			long begin = TimeManager.getInst().getBegin() - interval;

			EventBus.getMainEventBus().fireEvent(
					new DatesChangedEvent(begin, date));

		}
	});
	return jumpLast;
}
 
Example #26
Source File: EventSubscriptionWindow.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ClickHandler createCancelHandler() {
    return new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            EventSubscriptionWindow.this.hide();
        }
    };
}
 
Example #27
Source File: HtmlItemEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Prepares the popup body
 */
private void prepareBody() {
	setSavedHtmlContent(item.getValue() != null ? item.getValue().toString() : "");

	editorPanel = new HTMLPane();
	editorPanel.setID("htmlEditorPanel");
	editorPanel.setShowEdges(false);
	editorPanel.setContentsURL(Util.webEditorUrl(getHeight() - 230));
	editorPanel.setContentsType(ContentsType.PAGE);

	layout.addMember(editorPanel);

	ToolStrip toolStrip = new ToolStrip();
	toolStrip.setWidth100();
	toolStrip.setAlign(Alignment.RIGHT);
	toolStrip.addFill();

	ToolStripButton close = new ToolStripButton();
	close.setTitle(I18N.message("close"));
	toolStrip.addButton(close);
	close.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			onClose();
		}
	});

	layout.setMembers(toolStrip, editorPanel);
}
 
Example #28
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ImageButton createJumpToFirstValueButton() {
	ImageButton jumpFirst = new ImageButton("jumpFirst",
			"../img/icons/control_start_blue.png",
			i18n.jumpToFirst(),
			i18n.jumpToFirstExtended());
	View.getView().registerTooltip(jumpFirst);
	jumpFirst.addClickHandler(new ClickHandler() {

		public void onClick(ClickEvent event) {
			long date = LegendEntryTimeSeries.this.getTimeSeries()
					.getFirstValueDate();

			if (date == 0) {
				Toaster.getToasterInstance().addMessage(
						i18n.errorSOS() + ": "
								+ i18n.jumpToFirst());
				return;
			}

			long interval = TimeManager.getInst().getBegin() - date;

			long end = TimeManager.getInst().getEnd() - interval;

			EventBus.getMainEventBus().fireEvent(
					new DatesChangedEvent(date, end));

		}
	});
	return jumpFirst;
}
 
Example #29
Source File: RunLevelPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onDraw() {
	ToolStrip toolbar = new ToolStrip();
	toolbar.setWidth100();
	ToolStripButton save = new ToolStripButton(I18N.message("save"));
	save.setDisabled("demo".equals(Session.get().getConfig("runlevel")));
	save.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			onSave();
		}
	});
	currentRunlevel = ItemFactory.newRunlevelSelector();

	toolbar.addFormItem(currentRunlevel);
	toolbar.addSeparator();
	toolbar.addButton(save);

	Layout layout = new VLayout();
	layout.setWidth100();
	layout.setHeight100();
	layout.addMember(toolbar);
	layout.addMember(prepareAspectsTable());

	Tab tab = new Tab();
	tab.setTitle(I18N.message("runlevel"));
	tab.setPane(layout);

	TabSet tabs = new TabSet();
	tabs.setTabs(tab);

	setMembers(tabs);
}
 
Example #30
Source File: OtherUserRulesListGrid.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) {

    if (record != null) {
        String fieldName = this.getFieldName(colNum);

       if (fieldName.equals(EditRulesLayout.EDIT_RULES_COPY)) {
            // Copy button
            IButton copyButton = new IButton(i18n.copy());
            copyButton.setShowDown(false);
            copyButton.setShowRollOver(false);
            copyButton.setHeight(17);
            copyButton.setLayoutAlign(Alignment.CENTER);
            copyButton.setAlign(Alignment.CENTER);
            copyButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    System.out.println("copy " + record.getAttribute("name"));
                    String userID = getLoggedInUserId();
                    EventBus.getMainEventBus().fireEvent(new CopyEvent(userID, record.getAttribute("name")));
                }
            });
            return copyButton;
        }
    return null;
    }
    return null;
}