org.gwtportlets.portlet.client.edit.TitlePanelEditor.java Source code

Java tutorial

Introduction

Here is the source code for org.gwtportlets.portlet.client.edit.TitlePanelEditor.java

Source

/*
 * GWT Portlets Framework (http://code.google.com/p/gwtportlets/)
 * Copyright 2009 Business Systems Group (Africa)
 *
 * This file is part of GWT Portlets.
 *
 * GWT Portlets is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * GWT Portlets is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with GWT Portlets.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.gwtportlets.portlet.client.edit;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.MenuBar;
import org.gwtportlets.portlet.client.ui.TitlePanel;

/**
 * Editor for a CaptionPanel. Adds option to open dialog to edit caption
 * settings.
 */
public class TitlePanelEditor extends DefaultWidgetEditor {

    public TitlePanelEditor() {
    }

    public void createMenuItems(final PageEditor manager, MenuBar bar, final Widget widget) {
        super.createMenuItems(manager, bar, widget);

        bar.addItem("Edit Title...", new Command() {
            public void execute() {
                manager.displayEditWidgetDialog(widget, new TitlePanelDialog((TitlePanel) widget));
            }
        }).setTitle("Edit title settings");
    }

}