Java Code Examples for org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#setMinimalWidth()

The following examples show how to use org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#setMinimalWidth() . 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: UnhideWidgetCommand.java    From Orienteer with Apache License 2.0 7 votes vote down vote up
@Override
protected void initializeContent(final ModalWindow modal) {
	modal.setTitle(new ResourceModel("command.unhide"));
	modal.setContent(new UnhideWidgetDialog<T>(modal.getContentId()) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onSelectWidget(AbstractWidget<T> widget,
				Optional<AjaxRequestTarget> targetOptional) {
			targetOptional.ifPresent(modal::close);
			widget.setHidden(false);
			DashboardPanel<T> dashboard = getDashboardPanel();
			targetOptional.ifPresent(target -> dashboard.getDashboardSupport().ajaxAddWidget(widget, target));
		}
	});
	modal.setAutoSize(true);
	modal.setMinimalWidth(300);
}
 
Example 2
Source File: AddOArtifactCommand.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected void initializeContent(ModalWindow modal) {
    modal.setOutputMarkupPlaceholderTag(true);
    modal.setTitle(new ResourceModel(MODAL_WINDOW_TITLE));

    modal.setPageCreator(new ModalWindow.PageCreator() {
        @Override
        public Page createPage() {
            return modalWindowPage;
        }
    });

    modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        @Override
        public void onClose(AjaxRequestTarget target) {
            target.add(table);
        }
    });

    modal.setAutoSize(true);
    modal.setMinimalWidth(800);
    modal.setMinimalHeight(600);
    modalWindowPage.setModalWindow(modal);
}
 
Example 3
Source File: AddTabCommand.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
@Override
protected void initializeContent(final ModalWindow modal) {
	modal.setTitle(new ResourceModel("command.add.tab"));
	modal.setContent(new AddTabDialog<T>(modal.getContentId()) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onCreateTab(String name, Optional<AjaxRequestTarget> targetOptional) {
			targetOptional.ifPresent(modal::close);
			if(Strings.isEmpty(name)) {
				name = getLocalizer().getString("command.add.tab.modal.defaultname", null);
			}
			
			AbstractWidgetPage<T> page = (AbstractWidgetPage<T>)findPage();
			page.getCurrentDashboard().setModeObject(DisplayMode.VIEW); //Close action on current tab
			page.addTab(name);
			page.selectTab(name, targetOptional);
			send(page, Broadcast.DEPTH, new SwitchDashboardTabEvent(targetOptional));
			page.getCurrentDashboard().setModeObject(DisplayMode.EDIT); //Open action on new tab
			targetOptional.ifPresent(target -> target.add(page.getCurrentDashboardComponent()));
		}
	});
	modal.setAutoSize(true);
	modal.setMinimalWidth(300);
}
 
Example 4
Source File: AddWidgetCommand.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
@Override
protected void initializeContent(final ModalWindow modal) {
	modal.setTitle(new ResourceModel("command.add.widget"));
	modal.setContent(new AddWidgetDialog<T>(modal.getContentId()) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onSelectWidgetType(IWidgetType<T> type,
				Optional<AjaxRequestTarget> targetOptional) {
			targetOptional.ifPresent(modal::close);
			DashboardPanel<T> dashboard = getDashboardPanel();
			AbstractWidget<T> widget = dashboard.addWidget(type);
			targetOptional.ifPresent(target-> dashboard.getDashboardSupport().ajaxAddWidget(widget, target));
		}
	});
	modal.setAutoSize(true);
	modal.setMinimalWidth(300);
}
 
Example 5
Source File: LinkToSocialNetwork.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public Command<?> createCommand(String id) {
    IModel<ODocument> model = (IModel<ODocument>) getContext().getDisplayObjectModel();
    IModel<OrienteerUser> userModel = new ODocumentWrapperModel<>(new OrienteerUser(model.getObject()));

    return new AbstractModalWindowCommand<OrienteerUser>(id, getTitleModel(), userModel) {

        @Override
        protected void onInitialize() {
            super.onInitialize();
            applyVisualSettings(this);
            applyBehaviors(this);
        }

        @Override
        protected void onConfigure() {
            super.onConfigure();
            OrienteerUser user = getModelObject();

            setVisible(user.getSocialNetworks().size() < OAuth2Repository.getOAuth2Services().size());
        }

        @Override
        protected void initializeContent(ModalWindow modal) {
            modal.setTitle(getTitleModel());
            modal.setMinimalWidth(520);
            modal.setMinimalHeight(250);
            modal.setContent(new LinkToSocialNetworkPanel(modal.getContentId(), getModel()));
        }

        @Override
        public void onAfterModalSubmit() {
            sendActionPerformed();
        }

    };
}
 
Example 6
Source File: OArchitectEditorWidget.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
private ModalWindow createModalWindow(String id) {
    ModalWindow modal = new ModalWindow(id);
    modal.setOutputMarkupId(true);
    modal.setInitialWidth(MODAL_WINDOW_WIDTH);
    modal.setInitialHeight(MODAL_WINDOW_HEIGHT);
    modal.setMinimalWidth(MODAL_WINDOW_WIDTH);
    modal.setMinimalHeight(MODAL_WINDOW_HEIGHT);
    modal.setWindowClosedCallback(t -> t.appendJavaScript(OArchitectJsUtils.switchPageScroll(false)));
    return modal;
}
 
Example 7
Source File: AbstractDialog.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
public AbstractDialog(String id, IModel<T> model, final ModalWindow modal) {
	super(id, model);
	this.modal = modal;
	if(modal!=null) {
		modal.setMinimalWidth(400);
	}
}
 
Example 8
Source File: CreateODocumentCommand.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
protected void initializeContent(ModalWindow modal) {
	modal.setTitle(new ResourceModel("dialog.select.class"));
	modal.setAutoSize(true);
	modal.setMinimalWidth(300);
	modal.setContent(new SelectSubOClassDialogPage(modal, classModel) {
		
		@Override
		protected void onSelect(AjaxRequestTarget target, OClass selectedOClass) {
			redirectToCreateODocumentPage(target, selectedOClass);
		}
	});
}
 
Example 9
Source File: ViewUMLCommand.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
protected void initializeContent(ModalWindow modal) {
	modal.setTitle(new ResourceModel("command.viewUml.modal.title"));
	modal.setContent(new ViewUMLDialogPanel(modal.getContentId(), new PropertyModel<String>(this, "uml")));
	modal.setAutoSize(true);
	modal.setMinimalWidth(600);
	modal.setMinimalHeight(400);
}