Search in sources :

Example 1 with HomeModel

use of org.kie.workbench.common.screens.home.model.HomeModel in project kie-wb-common by kiegroup.

the class HomeProducer method get.

public HomeModel get() {
    final HomeModel model = new HomeModel("Welcome to KIE Workbench", "KIE Workbench offers a set of flexible tools, that support the way you need to work. Select a tool below to get started.", "images/home_bg.jpg");
    final HomeShortcut design = ModelUtils.makeShortcut("pficon pficon-blueprint", "Design", "Create and modify {0} and {1}.", () -> placeManager.goTo(LIBRARY), LIBRARY, PERSPECTIVE);
    design.addLink(new HomeShortcutLink("projects", LIBRARY));
    design.addLink(new HomeShortcutLink("pages", CONTENT_MANAGEMENT));
    final HomeShortcut devOps = ModelUtils.makeShortcut("fa fa-gears", "DevOps", "Administer {0} and {1}.", () -> placeManager.goTo(SERVER_MANAGEMENT), SERVER_MANAGEMENT, PERSPECTIVE);
    devOps.addLink(new HomeShortcutLink("deployments", DEPLOYMENTS));
    devOps.addLink(new HomeShortcutLink("servers", SERVER_MANAGEMENT));
    model.addShortcut(design);
    model.addShortcut(devOps);
    return model;
}
Also used : HomeShortcut(org.kie.workbench.common.screens.home.model.HomeShortcut) HomeShortcutLink(org.kie.workbench.common.screens.home.model.HomeShortcutLink) HomeModel(org.kie.workbench.common.screens.home.model.HomeModel)

Example 2 with HomeModel

use of org.kie.workbench.common.screens.home.model.HomeModel in project drools-wb by kiegroup.

the class HomeProducer method get.

public HomeModel get(ProfilePreferences profilePreferences) {
    final HomeModel model = new HomeModel("Welcome to KIE Workbench", "KIE Workbench offers a set of flexible tools, that support the way you need to work. Select a tool below to get started.", "images/home_bg.jpg");
    final HomeShortcut design = ModelUtils.makeShortcut("pficon pficon-blueprint", "Design", "Create and modify {0} and {1}.", () -> placeManager.goTo(LIBRARY), LIBRARY, PERSPECTIVE);
    design.addLink(new HomeShortcutLink("projects", LIBRARY));
    design.addLink(new HomeShortcutLink("pages", CONTENT_MANAGEMENT));
    final HomeShortcut devOps = ModelUtils.makeShortcut("fa fa-gears", "DevOps", "Administer {0} and {1}.", () -> placeManager.goTo(SERVER_MANAGEMENT), SERVER_MANAGEMENT, PERSPECTIVE);
    devOps.addLink(new HomeShortcutLink("provisioning", PROVISIONING));
    devOps.addLink(new HomeShortcutLink("servers", SERVER_MANAGEMENT));
    model.addShortcut(design);
    model.addShortcut(devOps);
    return model;
}
Also used : HomeShortcut(org.kie.workbench.common.screens.home.model.HomeShortcut) HomeShortcutLink(org.kie.workbench.common.screens.home.model.HomeShortcutLink) HomeModel(org.kie.workbench.common.screens.home.model.HomeModel)

Example 3 with HomeModel

use of org.kie.workbench.common.screens.home.model.HomeModel in project kie-wb-common by kiegroup.

the class HomeProducer method get.

public HomeModel get(ProfilePreferences preferences) {
    final HomeModel model = new HomeModel("Welcome to KIE Workbench", "KIE Workbench offers a set of flexible tools, that support the way you need to work. Select a tool below to get started.", "images/home_bg.jpg");
    final HomeShortcut design = ModelUtils.makeShortcut("pficon pficon-blueprint", "Design", "Create and modify {0} and {1}.", () -> placeManager.goTo(LIBRARY), LIBRARY, PERSPECTIVE);
    design.addLink(new HomeShortcutLink("projects", LIBRARY));
    design.addLink(new HomeShortcutLink("pages", CONTENT_MANAGEMENT));
    final HomeShortcut devOps = ModelUtils.makeShortcut("fa fa-gears", "DevOps", "Administer {0} and {1}.", () -> placeManager.goTo(SERVER_MANAGEMENT), SERVER_MANAGEMENT, PERSPECTIVE);
    devOps.addLink(new HomeShortcutLink("provisioning", PROVISIONING));
    devOps.addLink(new HomeShortcutLink("servers", SERVER_MANAGEMENT));
    model.addShortcut(design);
    model.addShortcut(devOps);
    return model;
}
Also used : HomeShortcut(org.kie.workbench.common.screens.home.model.HomeShortcut) HomeShortcutLink(org.kie.workbench.common.screens.home.model.HomeShortcutLink) HomeModel(org.kie.workbench.common.screens.home.model.HomeModel)

Example 4 with HomeModel

use of org.kie.workbench.common.screens.home.model.HomeModel in project kie-wb-common by kiegroup.

the class HomePresenterTest method setup.

@Before
public void setup() {
    doReturn(mock(ShortcutPresenter.class)).when(shortcutPresenters).get();
    executeParametrizedCommandWith(0, new ProfilePreferences(Profile.FULL)).when(profilePreferences).load(any(ParameterizedCommand.class), any(ParameterizedCommand.class));
    modelProvider = new HomeModelProvider() {

        @Override
        public void initialize(Runnable done) {
            done.run();
        }

        @Override
        public HomeModel get(ProfilePreferences profilePreferences) {
            final HomeModel homeModel = new HomeModel("welcome", "description", "backgroundImageUrl");
            homeModel.addShortcut(ModelUtils.makeShortcut("iconCss1", "heading1", "subHeading1", mock(Command.class)));
            homeModel.addShortcut(ModelUtils.makeShortcut("iconCss2", "heading2", "subHeading2", mock(Command.class), "resourceId2", ResourceType.UNKNOWN, ResourceAction.READ));
            homeModel.addShortcut(ModelUtils.makeShortcut("iconCss3", "heading3", "subHeading3", mock(Command.class), "perspectiveId"));
            return homeModel;
        }
    };
    presenter = new HomePresenter(view, translationService, modelProvider, shortcutPresenters, profilePreferences);
}
Also used : HomeModelProvider(org.kie.workbench.common.screens.home.model.HomeModelProvider) ParameterizedCommand(org.uberfire.mvp.ParameterizedCommand) Command(org.uberfire.mvp.Command) HomeModel(org.kie.workbench.common.screens.home.model.HomeModel) ShortcutPresenter(org.kie.workbench.common.screens.home.client.widgets.shortcut.ShortcutPresenter) ParameterizedCommand(org.uberfire.mvp.ParameterizedCommand) ProfilePreferences(org.kie.workbench.common.profile.api.preferences.ProfilePreferences) Before(org.junit.Before)

Example 5 with HomeModel

use of org.kie.workbench.common.screens.home.model.HomeModel in project drools-wb by kiegroup.

the class HomeProducer method get.

public HomeModel get() {
    final HomeModel model = new HomeModel("Welcome to KIE Workbench", "KIE Workbench offers a set of flexible tools, that support the way you need to work. Select a tool below to get started.", "images/home_bg.jpg");
    final HomeShortcut design = ModelUtils.makeShortcut("pficon pficon-blueprint", "Design", "Create and modify {0} and {1}.", () -> placeManager.goTo(LIBRARY), LIBRARY, PERSPECTIVE);
    design.addLink(new HomeShortcutLink("projects", LIBRARY));
    design.addLink(new HomeShortcutLink("pages", CONTENT_MANAGEMENT));
    final HomeShortcut devOps = ModelUtils.makeShortcut("fa fa-gears", "DevOps", "Administer {0} and {1}.", () -> placeManager.goTo(SERVER_MANAGEMENT), SERVER_MANAGEMENT, PERSPECTIVE);
    devOps.addLink(new HomeShortcutLink("deployments", DEPLOYMENTS));
    devOps.addLink(new HomeShortcutLink("servers", SERVER_MANAGEMENT));
    model.addShortcut(design);
    model.addShortcut(devOps);
    return model;
}
Also used : HomeShortcut(org.kie.workbench.common.screens.home.model.HomeShortcut) HomeShortcutLink(org.kie.workbench.common.screens.home.model.HomeShortcutLink) HomeModel(org.kie.workbench.common.screens.home.model.HomeModel)

Aggregations

HomeModel (org.kie.workbench.common.screens.home.model.HomeModel)6 HomeShortcut (org.kie.workbench.common.screens.home.model.HomeShortcut)4 HomeShortcutLink (org.kie.workbench.common.screens.home.model.HomeShortcutLink)4 ShortcutPresenter (org.kie.workbench.common.screens.home.client.widgets.shortcut.ShortcutPresenter)2 Before (org.junit.Before)1 ProfilePreferences (org.kie.workbench.common.profile.api.preferences.ProfilePreferences)1 HomeModelProvider (org.kie.workbench.common.screens.home.model.HomeModelProvider)1 Command (org.uberfire.mvp.Command)1 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)1