start implementatio for support the preview mode.
fix bring to front issue #6