WorkspaceHandlerExtension

Any extension that implements WorkspaceHandlerExtension will be looking at all the events fired from the workspace tab panel.

Methods

methodDescription

onChange(WorkspaceEventConstant event)

Each time it'll be some new tab panel event the method onChange it'll be triggered by OpenKM.

Sample

package com.openkm.extension.frontend.client;

import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.TabBar;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.openkm.frontend.client.extension.event.HasWorkspaceEvent.WorkspaceEventConstant;
import com.openkm.frontend.client.extension.event.handler.WorkspaceHandlerExtension;
import com.openkm.frontend.client.extension.widget.tabworkspace.TabWorkspaceExtension;

public class TabWorkspaceExample extends TabWorkspaceExtension implements WorkspaceHandlerExtension {

    private VerticalPanel vPanel;

    /**
     * TabWorkspaceExample
     */
    public TabWorkspaceExample() {
        vPanel = new VerticalPanel();
        vPanel.add(new HTML("new workspace example"));
        vPanel.setStyleName("okm-Input");

        initWidget(vPanel);
    }

    @Override
    public String getTabText() {
        return "tab workspace";
    }

    @Override
    public void setTab(TabBar tabBar, int tabIndex) {
    }

    @Override
    public void onChange(WorkspaceEventConstant event) {
        Window.alert("workspace event fired");
    }
}