mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DBE-23582 Show grid with subscription promo in free tier
GitOrigin-RevId: c3a16180302c45d082b56b799c82c6ed7a3db2f3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
66abd7c618
commit
a409f81f57
@@ -11,6 +11,7 @@
|
||||
<extensionPoint qualifiedName="com.intellij.database.datagrid.valueEditorTab" interface="com.intellij.database.run.ui.ValueEditorTab" dynamic="true"/>
|
||||
<extensionPoint qualifiedName="com.intellij.database.datagrid.cellViewerFactory" interface="com.intellij.database.run.ui.CellViewerFactory" dynamic="true"/>
|
||||
<extensionPoint qualifiedName="com.intellij.database.minimizedFormatDetector" interface="com.intellij.database.run.ui.MinimizedFormatDetector" dynamic="true"/>
|
||||
<extensionPoint qualifiedName="com.intellij.database.datagrid.customToolbarProvider" interface="com.intellij.database.datagrid.CustomGridToolbarProvider" dynamic="true"/>
|
||||
</extensionPoints>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.intellij.database.datagrid
|
||||
|
||||
import com.intellij.openapi.actionSystem.ActionGroup
|
||||
import com.intellij.openapi.actionSystem.ActionManager
|
||||
import com.intellij.openapi.actionSystem.ActionToolbar
|
||||
import com.intellij.openapi.extensions.ExtensionPointName
|
||||
import org.jetbrains.annotations.NonNls
|
||||
|
||||
interface CustomGridToolbarProvider {
|
||||
companion object {
|
||||
val EP_NAME: ExtensionPointName<CustomGridToolbarProvider> = ExtensionPointName.create("com.intellij.database.datagrid.customToolbarProvider")
|
||||
|
||||
fun createToolbar(dataGrid: DataGrid, @NonNls place: String, actions: ActionGroup): ActionToolbar {
|
||||
return EP_NAME.extensionList.firstNotNullOfOrNull { it.createToolbar(dataGrid, place, actions) }
|
||||
?: ActionManager.getInstance().createActionToolbar(place, actions, true)
|
||||
}
|
||||
}
|
||||
|
||||
fun createToolbar(dataGrid: DataGrid, @NonNls place: String, actions: ActionGroup): ActionToolbar?
|
||||
}
|
||||
@@ -109,6 +109,7 @@ import static com.intellij.database.DatabaseDataKeys.DATA_GRID_SETTINGS_KEY;
|
||||
import static com.intellij.database.DatabaseDataKeys.GRID_KEY;
|
||||
import static com.intellij.database.run.actions.ShowPaginationActionKt.getSHOW_PAGINATION;
|
||||
import static com.intellij.database.run.ui.DataAccessType.DATA_WITH_MUTATIONS;
|
||||
import static com.intellij.openapi.actionSystem.ActionPlaces.EDITOR_TOOLBAR;
|
||||
|
||||
public class GridUtil extends GridUtilCore {
|
||||
public static final int ADDITIONAL_ROWS_COUNT = 5;
|
||||
@@ -134,7 +135,7 @@ public class GridUtil extends GridUtilCore {
|
||||
public static void addBottomHeader(@NotNull DataGrid grid) {
|
||||
ActionManager actionManager = ActionManager.getInstance();
|
||||
ActionGroup actions = (ActionGroup)actionManager.getAction("Console.InEditorTableResult.Horizontal.Group");
|
||||
ActionToolbar toolbar = actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, actions, true);
|
||||
ActionToolbar toolbar = actionManager.createActionToolbar(EDITOR_TOOLBAR, actions, true);
|
||||
toolbar.setTargetComponent(grid.getPanel().getComponent());
|
||||
toolbar.getComponent().setOpaque(false);
|
||||
|
||||
@@ -803,9 +804,8 @@ public class GridUtil extends GridUtilCore {
|
||||
public static @NotNull JComponent addGridHeaderComponent(@NotNull DataGrid dataGrid, boolean transparent,
|
||||
ActionGroup actions,
|
||||
ActionGroup secondaryActions) {
|
||||
ActionManager actionManager = ActionManager.getInstance();
|
||||
ActionToolbar toolbar = actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, actions, true);
|
||||
ActionToolbar toolbarSecondary = actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, secondaryActions, true);
|
||||
ActionToolbar toolbar = CustomGridToolbarProvider.Companion.createToolbar(dataGrid, EDITOR_TOOLBAR, actions);
|
||||
ActionToolbar toolbarSecondary = CustomGridToolbarProvider.Companion.createToolbar(dataGrid, EDITOR_TOOLBAR, secondaryActions);
|
||||
toolbar.setTargetComponent(dataGrid.getPanel().getComponent());
|
||||
toolbarSecondary.setTargetComponent(dataGrid.getPanel().getComponent());
|
||||
toolbarSecondary.setReservePlaceAutoPopupIcon(false);
|
||||
@@ -832,7 +832,7 @@ public class GridUtil extends GridUtilCore {
|
||||
public static @NotNull JComponent addVerticalGridHeaderComponent(@NotNull DataGrid dataGrid, @Nullable String actionGroupName) {
|
||||
ActionManager actionManager = ActionManager.getInstance();
|
||||
ActionGroup actions = actionGroupName == null ? new EmptyActionGroup() : (ActionGroup)actionManager.getAction(actionGroupName);
|
||||
ActionToolbar toolbar = actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, actions, false);
|
||||
ActionToolbar toolbar = actionManager.createActionToolbar(EDITOR_TOOLBAR, actions, false);
|
||||
toolbar.setTargetComponent(dataGrid.getPanel().getComponent());
|
||||
|
||||
toolbar.getComponent().setOpaque(false);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.intellij.database.run.ui
|
||||
|
||||
import com.intellij.database.DatabaseDataKeys
|
||||
import com.intellij.database.datagrid.CustomGridToolbarProvider
|
||||
import com.intellij.database.datagrid.DataGrid
|
||||
import com.intellij.database.datagrid.GridUtil.getSettings
|
||||
import com.intellij.database.run.ui.TableResultPanel.LayeredPaneWithSizer
|
||||
@@ -55,11 +56,15 @@ class FloatingPagingManager {
|
||||
val actionManager = ActionManager.getInstance()
|
||||
val actions = actionManager.getAction("Console.TableResult.Pagination.Floating.Group") as ActionGroup
|
||||
val moreActions = actionManager.getAction("Console.TableResult.Pagination.Floating.MoreGroup") as ActionGroup
|
||||
val toolbar = actionManager.createActionToolbar(ActionPlaces.GRID_FLOATING_PAGING_TOOLBAR, DefaultActionGroup(
|
||||
actions,
|
||||
Separator.getInstance(),
|
||||
MoreActionGroup().apply { addAll(moreActions) }
|
||||
), true)
|
||||
val toolbar = CustomGridToolbarProvider.createToolbar(
|
||||
grid,
|
||||
ActionPlaces.GRID_FLOATING_PAGING_TOOLBAR,
|
||||
DefaultActionGroup(
|
||||
actions,
|
||||
Separator.getInstance(),
|
||||
MoreActionGroup().apply { addAll(moreActions) }
|
||||
)
|
||||
)
|
||||
toolbar.targetComponent = targetPane
|
||||
toolbar.component.isOpaque = true
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ public class TableResultPanel extends UserDataHolderBase
|
||||
private ErrorNotificationPanel myErrorNotificationPanel;
|
||||
|
||||
private final GridMainPanel myMainPanel;
|
||||
private final LayeredPaneWithSizer myLayeredPane;
|
||||
protected final LayeredPaneWithSizer myLayeredPane;
|
||||
private ResultView myResultView;
|
||||
|
||||
private final ActionGroup myPopupActionGroup;
|
||||
@@ -347,7 +347,7 @@ public class TableResultPanel extends UserDataHolderBase
|
||||
myColumnAttributes.myAnonymousColumnName = name;
|
||||
}
|
||||
|
||||
private void createResultView() {
|
||||
protected void createResultView() {
|
||||
myResultView = myViewFactory.createResultView(this, myColumnHeaderActions, myRowHeaderActions);
|
||||
|
||||
myColorModel = new GridColorModelImpl(this, getDatabaseMutator(this), myResultViewSettings.myTransparentRowHeaderBg, myResultViewSettings.myTransparentColumnHeaderBg);
|
||||
@@ -1604,17 +1604,18 @@ public class TableResultPanel extends UserDataHolderBase
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPresentationMode(@NotNull GridPresentationMode presentationMode) {
|
||||
if (myPresentationMode == presentationMode) return;
|
||||
protected final void reloadPresentation() {
|
||||
reloadPresentation(myPresentationMode, true);
|
||||
}
|
||||
|
||||
private void reloadPresentation(GridPresentationMode presentationMode, boolean force) {
|
||||
saveAndRestoreSelection(this, () -> {
|
||||
myPresentationMode = presentationMode;
|
||||
ResultViewFactory newFactory = ResultViewFactory.of(presentationMode);
|
||||
boolean requestFocusInSearchField = mySearchSession != null &&
|
||||
IdeFocusManager.getInstance(getProject()).getFocusOwner() ==
|
||||
mySearchSession.getComponent().getSearchTextComponent();
|
||||
if (myViewFactory != newFactory) {
|
||||
if (force || myViewFactory != newFactory) {
|
||||
boolean wasTransposed = myResultView.isTransposed();
|
||||
myViewFactory = newFactory;
|
||||
myLayeredPane.removeAll();
|
||||
@@ -1642,6 +1643,12 @@ public class TableResultPanel extends UserDataHolderBase
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPresentationMode(@NotNull GridPresentationMode presentationMode) {
|
||||
if (myPresentationMode == presentationMode) return;
|
||||
reloadPresentation(presentationMode, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull GridPresentationMode getPresentationMode() {
|
||||
return myPresentationMode;
|
||||
|
||||
@@ -294,7 +294,7 @@ public abstract class GridEditorPanelBase extends JPanel
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
DataGrid grid = getDataGrid(e.getDataContext());
|
||||
GridEditorPanel panel = grid == null ? null : myGetPanel.fun(grid);
|
||||
e.getPresentation().setEnabled(panel != null && LookupManager.getActiveLookup(panel.getEditor()) == null);
|
||||
e.getPresentation().setEnabled(panel != null && panel.getComponent().isEnabled() && LookupManager.getActiveLookup(panel.getEditor()) == null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,7 +51,6 @@ com.intellij.ide.FrameStateListener
|
||||
- onFrameDeactivated():V
|
||||
- onFrameDeactivated(com.intellij.openapi.wm.IdeFrame):V
|
||||
c:com.intellij.ide.HelpTooltip
|
||||
- psf:INFO_COLOR:java.awt.Color
|
||||
- p:createIsOverTipMouseListener():java.awt.event.MouseListener
|
||||
- p:shouldForceHiding():Z
|
||||
pc:com.intellij.ide.HelpTooltip$OverTipMouseListener
|
||||
|
||||
@@ -106,7 +106,7 @@ import static com.intellij.openapi.util.text.HtmlChunk.html;
|
||||
* The UI designer will offer to create {@code private void createUIComponents()} method where you can create the label with a static method.</p>
|
||||
*/
|
||||
public class HelpTooltip {
|
||||
protected static final Color INFO_COLOR = JBColor.namedColor("ToolTip.infoForeground", JBUI.CurrentTheme.ContextHelp.FOREGROUND);
|
||||
private static final Color INFO_COLOR = JBColor.namedColor("ToolTip.infoForeground", JBUI.CurrentTheme.ContextHelp.FOREGROUND);
|
||||
private static final Color LINK_COLOR = JBColor.namedColor("ToolTip.linkForeground", JBUI.CurrentTheme.Link.Foreground.ENABLED);
|
||||
|
||||
private static final JBValue MAX_WIDTH = new JBValue.UIInteger("HelpTooltip.maxWidth", 250);
|
||||
|
||||
Reference in New Issue
Block a user