com.google.gwt.place.shared.PlaceController Java Examples

The following examples show how to use com.google.gwt.place.shared.PlaceController. 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: EditorWorkFlow.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public EditorWorkFlow(EventBus ebus, PlaceController placeController,
        ActivityManager activityManager, Layout delegate,
        PresenterFactory presenterFactory, ClientMessages i18n) {

    this.presenterFactory = presenterFactory;
    this.i18n = i18n;
    this.ebus = (ebus != null) ? ebus : new SimpleEventBus();
    // PlaceController uses delegate to ask user with blocking Window.confirm
    // whether to leave the current place.
    // In order to use non blocking SmartGWT dialog
    // it will be necessary to override PlaceController.goto method.
    this.placeController = (placeController != null) ? placeController
            : new PlaceController(this.ebus);
    this.activityManager = (activityManager != null) ? activityManager
            : new ActivityManager(new EditorActivityMapper(), this.ebus);
    this.activityManager.setDisplay(new EditorDisplay(delegate));
    EditorPlaceHistoryMapper historyMapper = GWT.create(EditorPlaceHistoryMapper.class);
    placeHistoryHandler = new PlaceHistoryHandler(historyMapper);
    placeHistoryHandler.register(this.placeController, this.ebus, Place.NOWHERE);
}
 
Example #2
Source File: ApplicationClientModule.java    From bitcoin-transaction-explorer with MIT License 6 votes vote down vote up
@Override
protected void configure() {
  // Binding application critical architecture
  bind(ActivityMapper.class).to(ApplicationActivityMapper.class).in(Singleton.class);;
  bind(Place.class).annotatedWith(DefaultPlace.class).to(StartupPlace.class).in(Singleton.class);
  bind(PlaceController.class).to(ApplicationPlaceController.class).in(Singleton.class);
  bind(BitcoinPlaceRouter.class).to(ApplicationPlaceController.class).in(Singleton.class);
  bind(PlaceHistoryMapper.class).to(ApplicationPlaceHistoryMapper.class).in(Singleton.class);
  bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
  bind(ColorPicker.class).to(SimpleColorPicker.class).in(Singleton.class);

  // Binding views
  bind(StartupView.class).to(StartupViewImpl.class).in(Singleton.class);
  bind(TransactionView.class).to(TransactionViewImpl.class);
  bind(BlockView.class).to(BlockViewImpl.class);
  bind(MineView.class).to(MineViewImpl.class);
  bind(ScriptView.class).to(ScriptViewImpl.class);
  bind(ConfigView.class).to(ConfigViewImpl.class);
  bind(ContributeView.class).to(ContributeViewImpl.class);
  bind(RPCResponseView.class).to(RPCResponseViewImpl.class);
  bind(AddressView.class).to(AddressViewImpl.class);

  install(new GinFactoryModuleBuilder().build(ActivityFactory.class));
}
 
Example #3
Source File: ApplicationRootView.java    From bitcoin-transaction-explorer with MIT License 6 votes vote down vote up
@Inject
public ApplicationRootView(final PlaceHistoryMapper historyMapper, final PlaceController placeController, final UserApplicationConfig appConfig,
    NotificationPanel notificationPanel, ThemeSwitcher themeSwitcher) {
  this.placeController = placeController;
  this.notificationPanel = notificationPanel;
  this.themeSwitcher = themeSwitcher;

  EventBus simpleEventBus = new SimpleEventBus();

  notificationPanel.setEventBus(simpleEventBus);
  NotificationUtil.setEventBus(simpleEventBus);

  initWidget(UI_BINDER.createAndBindUi(this));

  applicationTitle.setText(appConfig.getApplicationTitle());
  applicationSubTitle.setText(appConfig.getApplicationSubTitle());

  contributeLink.setHref("#" + historyMapper.getToken(new ContributePlace()));
}
 
Example #4
Source File: DigitalObjectNavigateAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public static DigitalObjectNavigateAction parent(ClientMessages i18n, PlaceController places) {
    return new DigitalObjectNavigateAction(i18n,
            i18n.DigitalObjectNavigateAction_OpenParent_Title(),
            Page.getAppDir() + "images/16/next_up.png",
            i18n.DigitalObjectNavigateAction_OpenParent_Hint(),
            Navigation.PARENT,
            places);
}
 
Example #5
Source File: DigitalObjectParentEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public DigitalObjectParentEditor(ClientMessages i18n, PlaceController place) {
        this.i18n = i18n;
        this.place = place;
        chooser = new ImportParentChooser(i18n);
        chooser.setHandler(new ImportParentHandler() {

            @Override
            public void onParentSelectionUpdated() {
                if (autosave) {
//                    save();
                }
            }
        });
        initActions();
    }
 
Example #6
Source File: DigitalObjectEditAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public DigitalObjectEditAction(
        String title,
        String tooltip,
        String icon,
        DatastreamEditorType editorType,
        AcceptFilter filter,
        PlaceController places) {

    super(title, icon == null ? "[SKIN]/actions/edit.png" : icon, tooltip);
    this.editorType = editorType;
    this.places = places;
    this.filter = filter;
}
 
Example #7
Source File: DigitalObjectEditAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
/** Action accepting single selection. */
public DigitalObjectEditAction(
        String title,
        String tooltip,
        String icon,
        DatastreamEditorType editorType,
        PlaceController places) {

    this(title, tooltip, icon, editorType, new AcceptFilter(false, false), places);
}
 
Example #8
Source File: DigitalObjectNavigateAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public DigitalObjectNavigateAction(
        ClientMessages i18n, String title, String icon, String tooltip, Navigation navigation,
        PlaceController places) {

    super(title, icon, tooltip);
    this.navigation = navigation;
    this.places = places;
    this.i18n = i18n;
}
 
Example #9
Source File: DigitalObjectNavigateAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public static DigitalObjectNavigateAction previous(ClientMessages i18n, PlaceController places) {
    return new DigitalObjectNavigateAction(i18n,
            i18n.DigitalObjectNavigateAction_OpenPrevious_Title(),
            "[SKIN]/actions/prev.png",
            i18n.DigitalObjectNavigateAction_OpenPrevious_Hint(),
            Navigation.PREV,
            places);
}
 
Example #10
Source File: DigitalObjectNavigateAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public static DigitalObjectNavigateAction next(ClientMessages i18n, PlaceController places) {
    return new DigitalObjectNavigateAction(i18n,
            i18n.DigitalObjectNavigateAction_OpenNext_Title(),
            "[SKIN]/actions/next.png",
            i18n.DigitalObjectNavigateAction_OpenNext_Hint(),
            Navigation.NEXT,
            places);
}
 
Example #11
Source File: DigitalObjectNavigateAction.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public static DigitalObjectNavigateAction child(ClientMessages i18n, PlaceController places) {
    return new DigitalObjectNavigateAction(i18n,
            i18n.DigitalObjectNavigateAction_OpenChild_Title(),
            Page.getAppDir() + "images/16/next_down.png",
            i18n.DigitalObjectNavigateAction_OpenChild_Hint(),
            Navigation.CHILD,
            places);
}
 
Example #12
Source File: StartupActivity.java    From bitcoin-transaction-explorer with MIT License 5 votes vote down vote up
@Inject
public StartupActivity(final PlaceController placeController, final StartupView view) {
  this.placeController = placeController;
  this.view = view;

  view.setPresenter(this);
}
 
Example #13
Source File: WorkflowNewJobEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public WorkflowNewJobEditor(ClientMessages i18n, PlaceController places) {
    this.i18n = i18n;
    this.places = places;
    uiContainer = new VLayout();
    editor = new ModsMultiEditor(i18n);
    ToolStrip toolbar = Actions.createToolStrip();
    toolbar.setMembers(editor.getToolbarItems());

    uiContainer.addMembers(toolbar, editor.getUI());

}
 
Example #14
Source File: ImportPresenter.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public ImportPresenter(ClientMessages i18n, PlaceController placeController) {
    this.i18n = i18n;
    selectFolderStep = new SelectFolderStep();
    selectBatchStep = new SelectBatchStep();
    selectParentStep = new SelectParentStep();
    updateItemsStep = new UpdateItemsStep();
    finishedStep = new FinishedStep();
    wizard = new Wizard(i18n, selectFolderStep, selectBatchStep,
            updateItemsStep, selectParentStep, finishedStep);
    this.placeController = placeController;
}
 
Example #15
Source File: DigitalObjectEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private OptionalEditor(ClientMessages i18n, Layout previewContainer) {
    SimpleEventBus eventBus = new SimpleEventBus();
    embeddedPlaces = new PlaceController(eventBus);
    DigitalObjectEditor embeddedEditor = new DigitalObjectEditor(i18n, embeddedPlaces, true);
    embeddedEditor.setOptionalView(true);
    ActivityManager activityManager = new ActivityManager(
            new ChildActivities(embeddedEditor), eventBus);
    activityManager.setDisplay(new ChildEditorDisplay(previewContainer));
}
 
Example #16
Source File: DigitalObjectEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public DigitalObjectEditor(ClientMessages i18n, PlaceController places, boolean embedded) {
    this.i18n = i18n;
    this.places = places;
    this.editorCache = new EnumMap<DatastreamEditorType, EditorDescriptor>(DatastreamEditorType.class);
    this.widget = new VLayout();
    this.lblHeader = new Label();
    lblHeader.setAutoHeight();
    lblHeader.setPadding(4);
    lblHeader.setStyleName(Editor.CSS_PANEL_DESCRIPTION_TITLE);
    this.actionSource = new ActionSource(this);
    this.embeddedView = embedded;
    this.toolbar = Actions.createToolStrip();
    this.editorContainer = new VLayout();
    editorContainer.setLayoutMargin(4);
    editorContainer.setWidth100();
    editorContainer.setHeight100();

    widget.addMember(lblHeader);
    widget.addMember(toolbar);

    if (embedded) {
        widget.addMember(editorContainer);
    } else {
        editorContainer.setResizeBarTarget("next");
        HLayout multiView = new HLayout();
        multiView.setWidth100();
        multiView.setHeight100();
        multiView.setLayoutMargin(4);
        multiView.addMember(editorContainer);
        initOptionalEditor(multiView);
        widget.addMember(multiView);
    }
}
 
Example #17
Source File: Showcase.java    From requestor with Apache License 2.0 5 votes vote down vote up
@Override
public void onModuleLoad() {
    populateMenu();

    // Create view container
    final SimplePanel container = new SimplePanel();
    container.setStyleName("container requestor-showcase-container");
    RootPanel.get().add(container);

    // Main Factory (Dependency Injector)
    ShowcaseClientFactory clientFactory = CLIENT_FACTORY;
    EventBus eventBus = clientFactory.getEventBus();
    PlaceController placeController = clientFactory.getPlaceController();

    // Activity-Place binding
    ActivityMapper activityMapper = new ShowcaseActivityMapper();
    ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
    activityManager.setDisplay(container);

    // Place-History binding
    PlaceHistoryMapper historyMapper = new ShowcasePlaceHistoryMapper();
    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
    historyHandler.register(placeController, eventBus, defaultPlace);

    // Add Loading widget
    RootPanel.get().add(new Loading(eventBus));

    // Goes to place represented on URL or default place
    historyHandler.handleCurrentHistory();
}
 
Example #18
Source File: WorkflowTasksEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public WorkflowTasksEditor(ClientMessages i18n, PlaceController places) {
    this.i18n = i18n;
    this.places = places;
}
 
Example #19
Source File: ConfigActivity.java    From bitcoin-transaction-explorer with MIT License 4 votes vote down vote up
@Inject
public ConfigActivity(final ConfigView view, final ConfigServiceAsync service, final PlaceController placeController) {
  this.view = view;
  this.service = service;
  this.placeController = placeController;
}
 
Example #20
Source File: MainController.java    From lumongo with Apache License 2.0 4 votes vote down vote up
private MainController() {
	eventBus = new SimpleEventBus();
	placeController = new PlaceController(eventBus);
}
 
Example #21
Source File: MainController.java    From lumongo with Apache License 2.0 4 votes vote down vote up
public PlaceController getPlaceController() {
	return placeController;
}
 
Example #22
Source File: ShowcaseClientFactoryImpl.java    From requestor with Apache License 2.0 4 votes vote down vote up
@Override
public PlaceController getPlaceController() {
    return placeController;
}
 
Example #23
Source File: EditorWorkFlow.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public PlaceController getPlaceController() {
    return placeController;
}
 
Example #24
Source File: ImportBatchItemEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public ImportBatchItemEditor(ClientMessages i18n) {
        this.i18n = i18n;
        this.setHeight100();
        this.setWidth100();
        this.actionSource = new ActionSource(this);
        
        VLayout layout = new VLayout();
        layout.setShowResizeBar(true);
        layout.setResizeBarTarget("next");

        batchItemGrid = createItemList();
        layout.addMember(batchItemGrid);

        // child editors
        SimpleEventBus eventBus = new SimpleEventBus();
        childPlaces = new PlaceController(eventBus);
        childEditor = new DigitalObjectEditor(i18n, childPlaces, true);
        childDisplay = initDigitalObjectEditor(childEditor, eventBus);
        layout.addMember(childDisplay);

        HLayout editorThumbLayout = new HLayout();
        editorThumbLayout.setHeight100();
        editorThumbLayout.addMember(layout);

        thumbViewer = createThumbViewer();
        editorThumbLayout.addMember(thumbViewer);

        this.selectionCache = new SelectionCache<>(
                Optional.empty(),
                r -> batchItemGrid.getRecordIndex(r));

        VLayout editorThumbToolbarLayout = new VLayout();
        editorThumbToolbarLayout.setShowResizeBar(true);
        editorThumbToolbarLayout.setResizeBarTarget("next");

        createActions();
        ToolStrip editorToolStrip = createEditorToolBar(actionSource);
        editorThumbToolbarLayout.addMember(editorToolStrip);
        editorThumbToolbarLayout.addMember(editorThumbLayout);

        addMember(editorThumbToolbarLayout);

        digitalObjectPreview = new MediaEditor(i18n, MediaEditor.SOURCE_IMPORT_BATCH_ITEM_EDITOR);
        digitalObjectPreview.addBackgroundColorListeners(thumbViewer);
        digitalObjectPreview.setShowRefreshButton(true);
        ToolStrip previewToolbar = Actions.createToolStrip();
        previewToolbar.setMembers(digitalObjectPreview.getToolbarItems());
        VLayout previewLayout = new VLayout();
        previewLayout.setMembers(previewToolbar, digitalObjectPreview.getUI());
        previewLayout.setWidth("40%");
        previewLayout.setHeight100();
//        previewLayout.setShowResizeBar(true);
//        previewLayout.setResizeFrom("L");
        addMember(previewLayout);
        createEditorContextMenu(batchItemGrid.getContextMenu(), this);
        createEditorContextMenu(thumbViewer.getContextMenu(), this);
    }
 
Example #25
Source File: DigitalObjectChildrenEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public DigitalObjectChildrenEditor(ClientMessages i18n, PlaceController places, OptionalEditor preview) {
        this.i18n = i18n;
        this.places = places;
        this.preview = preview;
        this.actionSource = new ActionSource(this);
        this.goDownAction = DigitalObjectNavigateAction.child(i18n, places);
        relationDataSource = RelationDataSource.getInstance();
        childrenListGrid = initChildrenListGrid();
        this.selectionCache = SelectionCache.selector(childrenListGrid);
        VLayout childrenLayout = new VLayout();
        childrenLayout.setMembers(childrenListGrid);
        childrenLayout.setWidth("40%");
        childrenLayout.setShowResizeBar(true);

        SimpleEventBus eventBus = new SimpleEventBus();
        childPlaces = new PlaceController(eventBus);
        childEditor = new DigitalObjectEditor(i18n, childPlaces, true);
        ActivityManager activityManager = new ActivityManager(
                new ChildActivities(childEditor), eventBus);

        VLayout editorsLayout = new VLayout();
        VLayout editorsOuterLayout = new VLayout();
//        editorsLayout.setBorder("1px solid grey");
        editorsLayout.addStyleName("defaultBorder");
        editorsOuterLayout.setLayoutLeftMargin(4);
        editorsOuterLayout.setMembers(editorsLayout);
        activityManager.setDisplay(new ChildEditorDisplay(editorsLayout));

        widget = new HLayout();
        widget.setMembers(childrenLayout, editorsOuterLayout);
        relationDataSource.addRelationChangeHandler(new RelationChangeHandler() {

            @Override
            public void onRelationChange(RelationChangeEvent event) {
                // issue 262: isVisible seems to be always true and isAttached is always null.
                // Add test isDrawn that seems to change for dettached widgets.
                if (digitalObject != null && childrenListGrid.isVisible() && childrenListGrid.isDrawn()) {
                    String changedPid = event.getPid();
                    if (changedPid != null) {
                        Record changedRecord = childrenListGrid.getDataAsRecordList()
                                .find(RelationDataSource.FIELD_PID, changedPid);
                        if (changedRecord == null) {
                            // moved object(s)
                            // ListGrid does not remove selection of removed/moved rows
                            // and it does not fire selection change
                            // issue 246: clear selection of moved row
                            childrenListGrid.deselectAllRecords();
                            DigitalObjectCopyMetadataAction.resetSelection();
                            showCopySelection(new Record[0]);
                            return ;
                        }
                    }
                    final ListGridRecord[] selection = childrenListGrid.getSelectedRecords();
                    relationDataSource.updateCaches(digitalObject.getPid(), new BooleanCallback() {

                        @Override
                        public void execute(Boolean value) {
                            // refresh the copy selection as updated records are missing the copy attribute
                            showCopySelection(DigitalObjectCopyMetadataAction.getSelection());
                            // refresh the list selection
                            selectChildren(selection);
                        }
                    });
                }
            }
        });
    }
 
Example #26
Source File: WorkflowNewJob.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public WorkflowNewJob(ClientMessages i18n, PlaceController places) {
    this.i18n = i18n;
    this.places = places;
}
 
Example #27
Source File: DigitalObjectEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public DigitalObjectEditor(ClientMessages i18n, PlaceController places) {
    this(i18n, places, false);
}
 
Example #28
Source File: DigitalObjectCreator.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public DigitalObjectCreator(ClientMessages i18n, PlaceController places) {
    this.i18n = i18n;
    this.places = places;
    newDigObjectStep = new NewDigObjectStep();
    wizard = new Wizard(i18n, newDigObjectStep, Wizard.emptyStep());
}
 
Example #29
Source File: DeviceManager.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public DeviceManager(ClientMessages i18n, PlaceController places) {
    this.i18n = i18n;
}
 
Example #30
Source File: WorkflowJobsEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public WorkflowJobsEditor(ClientMessages i18n, PlaceController places) {
    this.i18n = i18n;
    this.places = places;
}