本文将介绍java.rmi.activation.ActivationSystem的实例源码的详细情况,特别是关于javavalidation源码解析的相关信息。我们将通过案例分析、数据研究等多种方式
本文将介绍java.rmi.activation.ActivationSystem的实例源码的详细情况,特别是关于java validation源码解析的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,同时也将涉及一些关于com.intellij.openapi.actionSystem.ActionGroupUtil的实例源码、com.intellij.openapi.actionSystem.ActionPlaces的实例源码、com.intellij.openapi.actionSystem.ActionToolbarPosition的实例源码、com.intellij.openapi.actionSystem.EmptyAction的实例源码的知识。
本文目录一览:- java.rmi.activation.ActivationSystem的实例源码(java validation源码解析)
- com.intellij.openapi.actionSystem.ActionGroupUtil的实例源码
- com.intellij.openapi.actionSystem.ActionPlaces的实例源码
- com.intellij.openapi.actionSystem.ActionToolbarPosition的实例源码
- com.intellij.openapi.actionSystem.EmptyAction的实例源码
java.rmi.activation.ActivationSystem的实例源码(java validation源码解析)
/** * Waits for systemStub to be initialized and returns its * initialized value. Any remote call that uses systemStub must * call this method to get it instead of using direct field * access. This is necessary because the super() call in the * constructor exports this object before systemStub is initialized * (see JDK-8023541),allowing remote calls to come in during this * time. We can't use checkShutdown() like other nested classes * because this is a static class. */ private synchronized ActivationSystem getSystemStub() { boolean interrupted = false; while (systemStub == null) { try { wait(); } catch (InterruptedException ie) { interrupted = true; } } if (interrupted) { Thread.currentThread().interrupt(); } return systemStub; }
/** * Waits for systemStub to be initialized and returns its * initialized value. Any remote call that uses systemStub must * call this method to get it instead of using direct field * access. This is necessary because the super() call in the * constructor exports this object before systemStub is initialized * (see JDK-8023541),allowing remote calls to come in during this * time. We can't use checkShutdown() like other nested classes * because this is a static class. */ private synchronized ActivationSystem getSystemStub() { boolean interrupted = false; while (systemStub == null) { try { wait(); } catch (InterruptedException ie) { interrupted = true; } } if (interrupted) { Thread.currentThread().interrupt(); } return systemStub; }
SystemRegistryImpl(int port,RMIClientSocketFactory csf,RMIServerSocketFactory ssf,ActivationSystem systemStub) throws remoteexception { super(port,csf,ssf); this.systemStub = systemStub; }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
SystemRegistryImpl(int port,ssf); assert systemStub != null; synchronized (this) { this.systemStub = systemStub; notifyAll(); } }
SystemRegistryImpl(int port,ssf); assert systemStub != null; synchronized (this) { this.systemStub = systemStub; notifyAll(); } }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
/** * Obtain the singleton instance of this class. * * @param folder the folder,where the activation system will keep its files. * @param cold do the cold start if true,hot (usual) if false. */ public static ActivationSystem getInstance(File folder,boolean cold) { if (singleton2 == null) singleton2 = new ActivationSystemImpl(folder,cold); return singleton2; }
/** * Obtain the singleton instance of this class. * * @param folder the folder,cold); return singleton2; }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
/** * Tests if getSystem() method successfully returns if this system was prevIoUsly * set to a proxy value (which is possible in real application when dynamic remote * stub is created for it) - regression test for HARMONY-1970. */ public void testGetSystemProxyObj() throws Exception { ActivationSystem system = (ActivationSystem) Proxy.newProxyInstance(null,new Class[] { ActivationSystem.class },new TestInvocationHandler()); ActivationGroup.setSystem(system); ActivationGroup.getSystem(); }
public void testStartup() throws Exception { SubProcess rmid = JavaInvoker.invokeSimilar((String[]) null,"org.apache.harmony.rmi.activation.Rmid",(String[]) null,true,true); rmid.pipeError(); rmid.pipeinput(); rmid.cloSEOutput(); Thread.sleep(5000); ActivationSystem as = ActivationGroup.getSystem(); assertNotNull(as); rmid.destroy(); }
public void testSimpleInstall() throws Exception { try { Properties props = new Properties(); ActivationGroupDesc groupDesc = new ActivationGroupDesc(props,null); System.out.println("groupDesc = " + groupDesc); System.out.flush(); ActivationSystem as = ActivationGroup.getSystem(); System.out.println("ActivationSystem = " + as); ActivationGroupID groupID = as.registerGroup(groupDesc); System.out.println("groupID = " + groupID); System.out.println("Activation group descriptor registered."); Marshalledobject data = new Marshalledobject("HelloImpl"); System.out.println("Marshalledobject data = " + data); ActivationDesc desc = new ActivationDesc(groupID,"org.apache.harmony.rmi.tests.java.rmi.activation.HelloImpl","",null); System.out.println("Registering ActivationDesc:"); Remote stub = Activatable.register(desc); System.out.println("Activation descriptor registered: " + stub); Registry reg = LocateRegistry.getRegistry(); System.out.println("Registry = " + reg); reg.rebind("HelloImpl_Stub",stub); System.out.println("Stub bound in registry."); } catch (Throwable t) { System.out.println("Exception in HelloInstaller: " + t); t.printstacktrace(); fail("Exception in HelloInstaller: " + t); } }
/** * Obtain the singleton instance of this class. * * @param folder the folder,cold); return singleton2; }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
/** * Obtain the singleton instance of this class. * * @param folder the folder,cold); return singleton2; }
/** * Tests if getSystem() method successfully returns if this system was prevIoUsly * set to a proxy value (which is possible in real application when dynamic remote * stub is created for it) - regression test for HARMONY-1970. */ public void testGetSystemProxyObj() throws Exception { ActivationSystem system = (ActivationSystem) Proxy.newProxyInstance(null,new TestInvocationHandler()); ActivationGroup.setSystem(system); ActivationGroup.getSystem(); }
public void testStartup() throws Exception { SubProcess rmid = JavaInvoker.invokeSimilar((String[]) null,true); rmid.pipeError(); rmid.pipeinput(); rmid.cloSEOutput(); Thread.sleep(5000); ActivationSystem as = ActivationGroup.getSystem(); assertNotNull(as); rmid.destroy(); }
public void testSimpleInstall() throws Exception { try { Properties props = new Properties(); ActivationGroupDesc groupDesc = new ActivationGroupDesc(props,stub); System.out.println("Stub bound in registry."); } catch (Throwable t) { System.out.println("Exception in HelloInstaller: " + t); t.printstacktrace(); fail("Exception in HelloInstaller: " + t); } }
public void testEquals() throws ActivationException { ActivationSystem as = new MyActivationSystem(); ActivationGroupID agid = new ActivationGroupID(as); ActivationGroupID agid2 = agid; ActivationGroupID agid3 = new ActivationGroupID(as); assertSame(agid2,agid); assertFalse(agid.equals(agid3)); }
public void testHashcode() throws ActivationException { ActivationSystem as = new MyActivationSystem(); ActivationGroupID agid = new ActivationGroupID(as); ActivationGroupID agid3 = new ActivationGroupID(as); assertTrue(agid.hashCode() != agid3.hashCode()); }
public void testToString() throws ActivationException { ActivationSystem as = new MyActivationSystem(); ActivationGroupID agid = new ActivationGroupID(as); ActivationGroupID agid3 = new ActivationGroupID(as); assertTrue(!agid.toString().equals(agid3.toString())); }
SystemRegistryImpl(int port,ssf); this.systemStub = systemStub; }
/** * Initialize the Activation instantiation; start activation * services. */ private void init(int port,ReliableLog log,String[] childArgs) throws Exception { // initialize this.log = log; numUpdates = 0; shutdownHook = new ShutdownHook(); groupSemaphore = getInt("sun.rmi.activation.groupThrottle",3); groupCounter = 0; Runtime.getRuntime().addShutdownHook(shutdownHook); // Use array size of 0,since the value from calling size() // may be out of date by the time toArray() is called. ActivationGroupID[] gids = groupTable.keySet().toArray(new ActivationGroupID[0]); synchronized (startupLock = new Object()) { // all the remote methods briefly synchronize on startupLock // (via checkShutdown) to make sure they don't happen in the // middle of this block. This block must not cause any such // incoming remote calls to happen,or deadlock would result! activator = new ActivatorImpl(port,ssf); activatorStub = (Activator) RemoteObject.toStub(activator); system = new ActivationSystemImpl(port,ssf); systemStub = (ActivationSystem) RemoteObject.toStub(system); monitor = new ActivationMonitorImpl(port,ssf); initCommand(childArgs); registry = new SystemRegistryImpl(port,null,ssf,systemStub); if (ssf != null) { synchronized (initLock) { initDone = true; initLock.notifyAll(); } } } startupLock = null; // restart services for (int i = gids.length; --i >= 0; ) { try { getGroupEntry(gids[i]).restartServices(); } catch (UnkNownGroupException e) { System.err.println( getTextResource("rmid.restart.group.warning")); e.printstacktrace(); } } }
/** * Initialize the Activation instantiation; start activation * services. */ private void init(int port,systemStub); if (ssf != null) { synchronized (initLock) { initDone = true; initLock.notifyAll(); } } } startupLock = null; // restart services for (int i = gids.length; --i >= 0; ) { try { getGroupEntry(gids[i]).restartServices(); } catch (UnkNownGroupException e) { System.err.println( getTextResource("rmid.restart.group.warning")); e.printstacktrace(); } } }
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port",Integer.toString(TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new RmidViaInheritedChannel(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj,0); Registry registry = LocateRegistry.createRegistry( TestLibrary.RMIDVIAINHERITEDCHANNEL_REGISTRY_PORT); registry.bind("Callback",proxy); /* * Start rmid. */ System.err.println("start rmid with inherited channel"); RMID.removeLog(); rmid = RMID.createRMID(System.out,System.err,false,TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"}); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024","-Djdk.net.ephemeralPortRange.high=64000" }); } rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj,true); } ActivationLibrary.rmidCleanup(rmid); } }
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port",Integer.toString(TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT)); RMID rmid = null; Callback obj = null; try { /* * Export callback object and bind in registry. */ System.err.println("export callback object and bind in registry"); obj = new CallbackImpl(); Callback proxy = (Callback) UnicastRemoteObject.exportObject(obj,0); Registry registry = LocateRegistry.createRegistry( TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT); registry.bind("Callback",TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions(new String[]{ "-Djava.nio.channels.spi.SelectorProvider=" + "InheritedChannelNotServerSocket$SP"}); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj,true); } ActivationLibrary.rmidCleanup(rmid); } }
/** * Initialize the Activation instantiation; start activation * services. */ private void init(int port,systemStub); if (ssf != null) { synchronized (initLock) { initDone = true; initLock.notifyAll(); } } } startupLock = null; // restart services for (int i = gids.length; --i >= 0; ) { try { getGroupEntry(gids[i]).restartServices(); } catch (UnkNownGroupException e) { System.err.println( getTextResource("rmid.restart.group.warning")); e.printstacktrace(); } } }
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port",0); Registry registry = TestLibrary.createRegistryOnEphemeralPort(); int registryPort = TestLibrary.getRegistryPort(registry); registry.bind("Callback",TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions( "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED","-Djava.nio.channels.spi.SelectorProvider=InheritedChannelNotServerSocket$SP","-Dtest.java.rmi.rmidViaInheritedChannel.registry.port=" + registryPort); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj,true); } if (rmid != null) { rmid.cleanup(); } } }
/** * Initialize the Activation instantiation; start activation * services. */ private void init(int port,systemStub); if (ssf != null) { synchronized (initLock) { initDone = true; initLock.notifyAll(); } } } startupLock = null; // restart services for (int i = gids.length; --i >= 0; ) { try { getGroupEntry(gids[i]).restartServices(); } catch (UnkNownGroupException e) { System.err.println( getTextResource("rmid.restart.group.warning")); e.printstacktrace(); } } }
public static void main(String[] args) throws Exception { System.setProperty("java.rmi.activation.port",TestLibrary.RMIDVIAINHERITEDCHANNEL_ACTIVATION_PORT); rmid.addOptions( "-XaddExports:java.base/sun.nio.ch=ALL-UNNAMED","-Djava.nio.channels.spi.SelectorProvider=RmidViaInheritedChannel$RmidSelectorProvider"); if (System.getProperty("os.name").startsWith("Windows") && System.getProperty("os.version").startsWith("5.")) { /* Windows XP/2003 or older * Need to expand ephemeral range to include RMI test ports */ rmid.addOptions(new String[]{ "-Djdk.net.ephemeralPortRange.low=1024",true); } if (rmid != null) { rmid.cleanup(); } } }
public static void main(String[] args) throws Exception { System.err.println("\nRegression test for bug 6261402\n"); System.setProperty("java.rmi.activation.port",TestLibrary.INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT); rmid.addOptions( "-XaddExports:java.base/sun.nio.ch=ALL-UNNAMED","-Djava.nio.channels.spi.SelectorProvider=InheritedChannelNotServerSocket$SP"); rmid.start(); /* * Get activation system and wait to be notified via callback * from rmid's selector provider. */ System.err.println("get activation system"); ActivationSystem system = ActivationGroup.getSystem(); System.err.println("ActivationSystem = " + system); synchronized (lock) { while (!notified) { lock.wait(); } } System.err.println("TEST PASSED"); } finally { if (obj != null) { UnicastRemoteObject.unexportObject(obj,true); } if (rmid != null) { rmid.cleanup(); } } }
com.intellij.openapi.actionSystem.ActionGroupUtil的实例源码
public void update(AnActionEvent e) { e.getPresentation().setVisible(!ActionGroupUtil.isGroupEmpty(this,e)); }
@Override public void update(AnActionEvent e) { e.getPresentation().setVisible(!ActionGroupUtil.isGroupEmpty(this,e)); }
public void update(AnActionEvent e) { e.getPresentation().setVisible(!ActionGroupUtil.isGroupEmpty(this,e,LaterInvocator.isInModalContext())); }
com.intellij.openapi.actionSystem.ActionPlaces的实例源码
@Override protected void createTrees(@NotNull final Map<String,JTree> type2TreeMap) { ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_CALL_HIERARCHY_POPUP); final JTree tree1 = createTree(false); PopupHandler.installPopupHandler(tree1,group,ActionPlaces.CALL_HIERARCHY_VIEW_POPUP,ActionManager.getInstance()); final BaSEOnThisMethodAction baSEOnThisMethodAction = new BaSEOnThisMethodAction(); baSEOnThisMethodAction .registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_CALL_HIERARCHY).getShortcutSet(),tree1); type2TreeMap.put(CALLEE_TYPE,tree1); final JTree tree2 = createTree(false); PopupHandler.installPopupHandler(tree2,ActionManager.getInstance()); baSEOnThisMethodAction .registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_CALL_HIERARCHY).getShortcutSet(),tree2); type2TreeMap.put(CALLER_TYPE,tree2); }
private void createConsole(@NotNull final NetService netService) { TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject()); netService.configureConsole(consoleBuilder); console = consoleBuilder.getConsole(); ApplicationManager.getApplication().invokelater(new Runnable() { @Override public void run() { ActionGroup actionGroup = netService.getConsoletoolWindowActions(); ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNowN,actionGroup,false); SimpletoolWindowPanel toolWindowPanel = new SimpletoolWindowPanel(false,true); toolWindowPanel.setContent(console.getComponent()); toolWindowPanel.setToolbar(toolbar.getComponent()); ToolWindow toolWindow = ToolWindowManager.getInstance(netService.getProject()) .registerToolWindow(netService.getConsoletoolWindowId(),false,ToolWindowAnchor.BottOM,netService.getProject(),true); toolWindow.setIcon(netService.getConsoletoolWindowIcon()); Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel,"",false); disposer.register(content,console); toolWindow.getContentManager().addContent(content); } },netService.getProject().getdisposed()); }
private void run(KeyEvent event) { myIsRunningAction = true; try { ActionManagerEx actionManager = ActionManagerEx.getInstanceEx(); AnAction action = actionManager.getAction(myActionId); DataContext context = DataManager.getInstance().getDataContext(IdeFocusManager.findInstance().getFocusOwner()); AnActionEvent anActionEvent = AnActionEvent.createFromAnAction(action,event,ActionPlaces.MAIN_MENU,context); actionManager.fireBeforeActionPerformed(action,anActionEvent.getDataContext(),anActionEvent); action.actionPerformed(anActionEvent); actionManager.fireAfteractionPerformed(action,anActionEvent); } finally { myIsRunningAction = false; } }
@Override public void updateRecentProjectsMenu () { RecentProjectsManager projectsManager = RecentProjectsManager.getInstance(); if (projectsManager == null) return; final AnAction[] recentProjectActions = projectsManager.getRecentProjectsActions(false); recentProjectsMenu.removeAll(); for (final AnAction action : recentProjectActions) { MenuItem menuItem = new MenuItem(((ReopenProjectAction)action).getProjectName()); menuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { action.actionPerformed(AnActionEvent.createFromAnAction(action,null,ActionPlaces.DOCK_MENU,DataManager.getInstance().getDataContext(null))); } }); recentProjectsMenu.add(menuItem); } }
protected static boolean isModuleInProjectViewPopup(AnActionEvent e) { if (ActionPlaces.PROJECT_VIEW_POPUP.equals(e.getPlace())) { final Project project = getEventProject(e); final Module module = LangDataKeys.MODULE.getData(e.getDataContext()); if (project != null && module != null) { final VirtualFile moduleFolder = CommonDataKeys.VIRTUAL_FILE.getData(e.getDataContext()); if (moduleFolder == null) { return false; } if (ProjectRootsUtil.isModuleContentRoot(moduleFolder,project) || ProjectRootsUtil.isModuleSourceRoot(moduleFolder,project)) { return true; } } } return false; }
@Override public void update(@NotNull final AnActionEvent e) { Presentation p = e.getPresentation(); IdeFrameEx frame = null; boolean isApplicable = WindowManager.getInstance().isFullScreenSupportedInCurrentOS() && (frame = getFrame()) != null; if (e.getPlace() != ActionPlaces.MAIN_TOOLBAR) { p.setVisible(isApplicable); } p.setEnabled(isApplicable); if (isApplicable) { p.setText(frame.isInFullScreen() ? TEXT_EXIT_FULL_SCREEN : TEXT_ENTER_FULL_SCREEN); } }
@Override public void update(final AnActionEvent event) { Presentation presentation = event.getPresentation(); boolean hidden = isHidden(event); if (hidden) { presentation.setEnabledAndVisible(false); return; } boolean enabled = isEnabled(event); if (myHidedisabledInPopup && ActionPlaces.isPopupPlace(event.getPlace())) { presentation.setVisible(enabled); } else { presentation.setVisible(true); } presentation.setEnabled(enabled); }
private ActionToolbarImpl createtoolbar() { final DefaultActionGroup framesGroup = new DefaultActionGroup(); CommonActionsManager actionsManager = CommonActionsManager.getInstance(); framesGroup.add(actionsManager.createPrevOccurenceAction(getFramesList())); framesGroup.add(actionsManager.createNextOccurenceAction(getFramesList())); framesGroup.addAll(ActionManager.getInstance().getAction(XDebuggerActions.FRAMES_TOP_TOOLBAR_GROUP)); final ActionToolbarImpl toolbar = (ActionToolbarImpl)ActionManager.getInstance().createActionToolbar(ActionPlaces.DEBUGGER_TOOLBAR,framesGroup,true); toolbar.setReservePlaceAutopopupIcon(false); toolbar.setAddSeparatorFirst(true); toolbar.getComponent().setBorder(new EmptyBorder(1,0)); return toolbar; }
@Override protected void update(final VcsContext vcsContext,final Presentation presentation) { super.update(vcsContext,presentation); if (presentation.isVisible() && presentation.isEnabled()) { final changelist[] selectedchangelists = vcsContext.getSelectedchangelists(); final Change[] selectedChanges = vcsContext.getSelectedChanges(); if (vcsContext.getPlace().equals(ActionPlaces.CHANGES_VIEW_POPUP)) { if (selectedchangelists != null && selectedchangelists.length > 0) { presentation.setEnabled(selectedchangelists.length == 1 && !ContainerUtil.isEmpty(selectedchangelists[0].getChanges())); } else { presentation.setEnabled (selectedChanges != null && selectedChanges.length > 0); } } if (presentation.isEnabled() && selectedChanges != null) { final changelistManager changelistManager = changelistManager.getInstance(vcsContext.getProject()); for(Change c: selectedChanges) { if (c.getFileStatus() == FileStatus.HIJACKED && changelistManager.getchangelist(c) == null) { presentation.setEnabled(false); break; } } } } }
public SearchTextArea(boolean search) { myTextArea = new JTextArea(); setBorder(JBUI.Borders.empty(6,6,8)); setLayout(new BorderLayout(JBUI.scale(4),0)); myTextArea.addPropertychangelistener("background",this); myTextArea.addFocusListener(this); myTextArea.setBorder(null); myTextArea.setopaque(false); JBScrollPane scrollPane = new JBScrollPane(myTextArea,ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.getVerticalScrollBar().setBackground(UIUtil.TRANSPARENT_COLOR); scrollPane.getViewport().setBorder(null); scrollPane.getViewport().setopaque(false); scrollPane.setBorder(JBUI.Borders.emptyRight(2)); scrollPane.setopaque(false); ShowHistoryAction historyAction = new ShowHistoryAction(search); ActionButton button = new ActionButton(historyAction,historyAction.getTemplatePresentation(),ActionPlaces.UNKNowN,new Dimension(JBUI.scale(16),JBUI.scale(16))); button.setLook(new InplaceActionButtonLook()); JPanel p = new NonopaquePanel(new BorderLayout()); p.add(button,BorderLayout.norTH); add(p,BorderLayout.WEST); add(scrollPane,BorderLayout.CENTER); }
@Override public void update(AnActionEvent e) { boolean plural = false; boolean enabled; DataContext dataContext = e.getDataContext(); Editor editor = CommonDataKeys.EDITOR.getData(dataContext); if (editor != null && FileDocumentManager.getInstance().getFile(editor.getDocument()) != null) { enabled = true; } else { List<PsiElement> elements = getElementsTocopy(editor,dataContext); enabled = !elements.isEmpty(); plural = elements.size() > 1; } e.getPresentation().setEnabled(enabled); if (ActionPlaces.isPopupPlace(e.getPlace())) { e.getPresentation().setVisible(enabled); } else { e.getPresentation().setVisible(true); } e.getPresentation().setText(plural ? "cop&y References" : "cop&y Reference"); }
@Override public void update(@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); OpenInbrowserRequest result = BaSEOpenInbrowserAction.doUpdate(e); if (result == null) { return; } String description = getTemplatePresentation().getDescription(); if (HtmlUtil.isHtmlFile(result.getFile())) { description += " (hold Shift to open URL of local file)"; } presentation.setText(getTemplatePresentation().getText()); presentation.setDescription(description); Webbrowser browser = findUsingbrowser(); if (browser != null) { presentation.setIcon(browser.getIcon()); } if (ActionPlaces.isPopupPlace(e.getPlace())) { presentation.setVisible(presentation.isEnabled()); } }
public void createtoolWindowContent(@NotNull ToolWindow toolWindow) { //Create runner UI layout RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject); RunnerLayoutUi layoutUi = factory.create("","session",myProject); // Adding actions DefaultActionGroup group = new DefaultActionGroup(); layoutUi.getoptions().setLeftToolbar(group,ActionPlaces.UNKNowN); Content console = layoutUi.createContent(GradleConsoletoolWindowFactory.ID,myConsoleView.getComponent(),null); AnAction[] consoleActions = myConsoleView.createConsoleActions(); for (AnAction action : consoleActions) { if (!shouldIgnoreAction(action)) { group.add(action); } } layoutUi.addContent(console,PlaceInGrid.right,false); JComponent layoutComponent = layoutUi.getComponent(); myConsolePanel.add(layoutComponent,BorderLayout.CENTER); //noinspection ConstantConditions Content content = ContentFactory.SERVICE.getInstance().createContent(layoutComponent,true); toolWindow.getContentManager().addContent(content); }
public StatisticsPanel() { super(new BorderLayout(0,0)); myChildInfo = new StatisticsTable(TestColumnInfo.COLUMN_NAMES); myTable = new TableView(myChildInfo) { @Override public TableCellRenderer getCellRenderer(int row,int column) { return new TestTableRenderer(TestColumnInfo.COLUMN_NAMES); } }; EditSourceondoubleclickHandler.install(myTable); PopupHandler.installPopupHandler(myTable,IdeActions.GROUP_TESTSTATISTICS_POPUP,ActionPlaces.TESTSTATISTICS_VIEW_POPUP); // add(myTestCaseInfo,BorderLayout.norTH); add(ScrollPaneFactory.createScrollPane(myTable),BorderLayout.CENTER); final JPanel eastPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP,true,false)); myTotalLabel = new SimpleColoredComponent(); eastPanel.add(myTotalLabel); myTimeLabel = new SimpleColoredComponent(); eastPanel.add(myTimeLabel); add(eastPanel,BorderLayout.soUTH); }
private Content setUpToolWindow() { //Create runner UI layout final RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject); final RunnerLayoutUi layoutUi = factory.create("",myProject); // Adding actions DefaultActionGroup group = new DefaultActionGroup(); group.add(myKillAction); group.addSeparator(); layoutUi.getoptions().setLeftToolbar(group,ActionPlaces.UNKNowN); final Content console = layoutUi.createContent(CONSOLE_ID,myConsole.getComponent(),null); layoutUi.addContent(console,false); final JComponent uiComponent = layoutUi.getComponent(); myPanel.add(uiComponent,BorderLayout.CENTER); final ContentManager manager = myToolWindow.getContentManager(); final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); final Content content = contentFactory.createContent(uiComponent,true); manager.addContent(content); return content; }
@Override protected void updateForBlazeProject(Project project,AnActionEvent e) { Presentation presentation = e.getPresentation(); DataContext dataContext = e.getDataContext(); VirtualFile virtualFile = CommonDataKeys.VIRTUAL_FILE.getData(dataContext); BlazePackage blazePackage = getBuildFile(project,virtualFile); if (blazePackage != null && virtualFile.equals(blazePackage.buildFile.getVirtualFile())) { presentation.setEnabledAndVisible(false); return; } boolean visible = virtualFile != null; boolean enabled = blazePackage != null; presentation.setVisible(visible || ActionPlaces.isMainMenuOrActionSearch(e.getPlace())); presentation.setEnabled(enabled); }
private void popupInvoked(final Component comp,final int x,final int y) { Object userObject = null; final TreePath path = tree.getSelectionPath(); if(path != null) { final DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent(); if(node != null) { userObject = node.getUserObject(); } } ActionManager actionManager = ActionManager.getInstance(); DefaultActionGroup group = new DefaultActionGroup(); if( userObject instanceof SlingServerNodeDescriptor || userObject instanceof SlingServerModuleNodeDescriptor ) { group.add(actionManager.getAction("AEM.Connection.Popup")); } else { group.add(actionManager.getAction("AEM.Root.Popup")); } final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.ANT_EXPLORER_POPUP,group); popupMenu.getComponent().show(comp,x,y); }
/** * Creats the tool window content * @param toolWindow */ public void createtoolWindowContent(@NotNull ToolWindow toolWindow) { //Create runner UI layout RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(project); RunnerLayoutUi layoutUi = factory.create("",project); // Adding actions DefaultActionGroup group = new DefaultActionGroup(); layoutUi.getoptions().setLeftToolbar(group,ActionPlaces.UNKNowN); Content console = layoutUi.createContent(EmbeddedLinuxJVMToolWindowFactory.ID,consoleView.getComponent(),null); AnAction[] consoleActions = consoleView.createConsoleActions(); for (AnAction action : consoleActions) { if (!shouldIgnoreAction(action)) { group.add(action); } } layoutUi.addContent(console,false); JComponent layoutComponent = layoutUi.getComponent(); myConsolePanel.add(layoutComponent,BorderLayout.CENTER); Content content = ContentFactory.SERVICE.getInstance().createContent(layoutComponent,true); toolWindow.getContentManager().addContent(content); }
@Override public void createtoolWindowContent( @NotNull final Project project,@NotNull ToolWindow toolWindow) { toolWindow.setAvailable(true,null); toolWindow.setToHideOnEmptyContent(true); RunnerLayoutUi runnerLayoutUi = BuckUIManager.getInstance(project).getLayoutUi(project); Content consoleContent = createConsoleContent(runnerLayoutUi,project); runnerLayoutUi.addContent(consoleContent,PlaceInGrid.center,false); runnerLayoutUi.getoptions().setLeftToolbar( getLeftToolbaractions(project),ActionPlaces.UNKNowN); runnerLayoutUi.updateActionsNow(); final ContentManager contentManager = toolWindow.getContentManager(); Content content = contentManager.getFactory().createContent( runnerLayoutUi.getComponent(),true); contentManager.addContent(content); updateBuckToolWindowTitle(project); }
/** Executes the standard add and remove watch from the watch list. */ private void executeAction(@NotNull String watch) { AnAction action = ActionManager.getInstance().getAction(watch); Presentation presentation = action.getTemplatePresentation().clone(); DataContext context = DataManager.getInstance().getDataContext(treePanel.getTree()); AnActionEvent actionEvent = new AnActionEvent( null,context,ActionPlaces.DEBUGGER_TOOLBAR,presentation,ActionManager.getInstance(),0); action.actionPerformed(actionEvent); }
@Override public void createtoolWindowContent(Project project,ToolWindow toolWindow) { final Document document = new PlainDocument(); final NetConsoleClient netConsole = new NetConsoleClient(document); final JXTextArea textArea = new JXTextArea(); textArea.setDocument(document); textArea.setEditable(false); final DefaultActionGroup actionGroup = new DefaultActionGroup(); actionGroup.addAction(new AutoScrollAction(netConsole,textArea)); actionGroup.addAction(new Clearaction(netConsole)); actionGroup.addAction(new disableAction(netConsole,textArea)); final SimpletoolWindowPanel netConsolePanel = new SimpletoolWindowPanel(false,false); final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNowN,false); netConsolePanel.setToolbar(toolbar.getComponent()); netConsolePanel.setContent(new JBScrollPane(textArea)); final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); final Content content = contentFactory.createContent(netConsolePanel,true); toolWindow.getContentManager().addContent(content); }
public OCamlTopLevelConsoleView(@NotNull final Project project,@NotNull final ContentManager contentManager,final Sdk topLevelSdk) throws ExecutionException { super(project,contentManager); myConsoleNumber = ++ourLastConsoleNumber; final GeneralCommandLine cmd = createCommandLine(topLevelSdk); myConsoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole(); myProcessHandler = new OSProcessHandler(cmd.createProcess(),cmd.getCommandLinestring()); myConsoleView.attachToProcess(myProcessHandler); ProcessterminatedListener.attach(myProcessHandler); setLayout(new BoxLayout(this,BoxLayout.X_AXIS)); final DefaultActionGroup group = new DefaultActionGroup(); group.add(getoCamlToolWindowOpenCloseAction(true,false)); group.addAll(myConsoleView.createConsoleActions()); group.add(getoCamlToolWindowSettingsAction()); group.add(getoCamlToolWindowOpenCloseAction(false,true)); final JComponent toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNowN,false).getComponent(); toolbar.setMaximumSize(new Dimension(toolbar.getPreferredSize().width,Integer.MAX_VALUE)); add(toolbar); add(myConsoleView.getComponent()); myConsoleView.getComponent().requestFocus(); myProcessHandler.startNotify(); }
public void update(AnActionEvent e) { boolean enable = false; StackFrameProxyImpl stackFrameProxy = getStackFrameProxy(e); if(stackFrameProxy != null && isAtBreakpoint(e)) { VirtualMachineProxyImpl virtualMachineProxy = stackFrameProxy.getVirtualMachine(); enable = virtualMachineProxy.canPopFrames(); } if(ActionPlaces.MAIN_MENU.equals(e.getPlace()) || ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace())) { e.getPresentation().setEnabled(enable); } else { e.getPresentation().setVisible(enable); } }
@Override protected void createTrees(@NotNull final Map<String,tree2); }
public static EditorPopupHandler createEditorPopupHandler(final String groupId) { return new EditorPopupHandler() { @Override public void invokePopup(final EditorMouseEvent event) { if (!event.isConsumed() && event.getArea() == EditorMouseEventArea.EDITING_AREA) { ActionGroup group = (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(groupId); ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.EDITOR_POPUP,group); MouseEvent e = event.getMouseEvent(); final Component c = e.getComponent(); if (c != null && c.isShowing()) { popupMenu.getComponent().show(c,e.getX(),e.getY()); } e.consume(); } } }; }
public void updateRecentProjectsMenu () { final AnAction[] recentProjectActions = RecentProjectsManagerBase.getInstance().getRecentProjectsActions(false); recentProjectsMenu.removeAll(); for (final AnAction action : recentProjectActions) { MenuItem menuItem = new MenuItem(((ReopenProjectAction)action).getProjectName()); menuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { action.actionPerformed(new AnActionEvent(null,DataManager.getInstance().getDataContext(null),action.getTemplatePresentation(),0)); } }); recentProjectsMenu.add(menuItem); } }
protected static boolean isModuleInProjectViewPopup(AnActionEvent e) { if (ActionPlaces.PROJECT_VIEW_POPUP.equals(e.getPlace())) { final Project project = getEventProject(e); final Module module = LangDataKeys.MODULE.getData(e.getDataContext()); if (project != null && module != null) { final VirtualFile moduleFolder = PlatformDataKeys.VIRTUAL_FILE.getData(e.getDataContext()); if (moduleFolder == null) { return false; } if (ProjectRootsUtil.isModuleContentRoot(moduleFolder,project) || ProjectRootsUtil.isSourceOrTestRoot(moduleFolder,project)) { return true; } } } return false; }
@Override protected boolean isEnabled(AnActionEvent e) { Project project = e.getData(PlatformDataKeys.PROJECT); if (project == null) return false; boolean haveCurrentSession = false; for (DebuggerSupport support : DebuggerSupport.getDebuggerSupports()) { final AbstractDebuggerSession session = support.getCurrentSession(project); if (session != null && !session.isstopped()) { haveCurrentSession = true; if (session.isPaused()) { return true; } } } return !ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace()) && !haveCurrentSession; }
@Override protected void update(final VcsContext vcsContext,presentation); if (presentation.isVisible() && presentation.isEnabled()) { final changelist[] selectedchangelists = vcsContext.getSelectedchangelists(); final Change[] selectedChanges = vcsContext.getSelectedChanges(); if (vcsContext.getPlace().equals(ActionPlaces.CHANGES_VIEW_POPUP)) { if (selectedchangelists != null && selectedchangelists.length > 0) { presentation.setEnabled(selectedchangelists.length == 1); } else { presentation.setEnabled (selectedChanges != null && selectedChanges.length > 0); } } if (presentation.isEnabled() && selectedChanges != null) { final changelistManager changelistManager = changelistManager.getInstance(vcsContext.getProject()); for(Change c: selectedChanges) { if (c.getFileStatus() == FileStatus.HIJACKED && changelistManager.getchangelist(c) == null) { presentation.setEnabled(false); break; } } } } }
public StatisticsPanel() { super(new BorderLayout(0,BorderLayout.soUTH); }
private Content setUpToolWindow() { //Create runner UI layout final RunnerLayoutUi.Factory factory = RunnerLayoutUi.Factory.getInstance(myProject); final RunnerLayoutUi layoutUi = factory.create("",true); manager.addContent(content); return content; }
private boolean checkShowPopupMenu(final MouseEvent e) { int cell = getCellAt(e.getPoint()); if(cell >= 0 && e.isPopupTrigger()) { if(!mySelectionModel.isSelectedindex(cell)) { mySelectionModel.setSelectionInterval(cell,cell); } ActionGroup group = mySelectedContainer.getGridLayoutManager().getCaptionActions(); if(group != null) { final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UNKNowN,group); popupMenu.getComponent().show(GridCaptionPanel.this,e.getY()); return true; } } return false; }
@Override public void updateRecentProjectsMenu () { RecentProjectsManager projectsManager = RecentProjectsManager.getInstance(); if (projectsManager == null) return; final AnAction[] recentProjectActions = projectsManager.getRecentProjectsActions(false); recentProjectsMenu.removeAll(); for (final AnAction action : recentProjectActions) { MenuItem menuItem = new MenuItem(((ReopenProjectAction)action).getProjectName()); menuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { action.actionPerformed(AnActionEvent.createFromAnAction(action,DataManager.getInstance().getDataContext((Component)null))); } }); recentProjectsMenu.add(menuItem); } }
@Override protected void update(final VcsContext vcsContext,presentation); if (presentation.isVisible() && presentation.isEnabled()) { final changelist[] selectedchangelists = vcsContext.getSelectedchangelists(); final Change[] selectedChanges = vcsContext.getSelectedChanges(); if (vcsContext.getPlace().equals(ActionPlaces.CHANGES_VIEW_POPUP)) { if (selectedchangelists != null && selectedchangelists.length > 0) { presentation.setEnabled(selectedchangelists.length == 1); } else { presentation.setEnabled (selectedChanges != null && selectedChanges.length > 0); } } if (presentation.isEnabled() && selectedChanges != null) { final changelistManager changelistManager = changelistManager.getInstance(vcsContext.getProject()); for(Change c: selectedChanges) { if (c.getFileStatus() == FileStatus.HIJACKED && changelistManager.getchangelist(c) == null) { presentation.setEnabled(false); break; } } } } }
@Override public void update(AnActionEvent e) { boolean plural = false; boolean enabled; DataContext dataContext = e.getDataContext(); Editor editor = dataContext.getData(CommonDataKeys.EDITOR); if (editor != null && FileDocumentManager.getInstance().getFile(editor.getDocument()) != null) { enabled = true; } else { List<PsiElement> elements = getElementsTocopy(editor,dataContext); enabled = !elements.isEmpty(); plural = elements.size() > 1; } e.getPresentation().setEnabled(enabled); if (ActionPlaces.isPopupPlace(e.getPlace())) { e.getPresentation().setVisible(enabled); } else { e.getPresentation().setVisible(true); } e.getPresentation().setText(plural ? "cop&y References" : "cop&y Reference"); }
protected void initialize(final DomTableView boundComponent) { if (boundComponent == null) { myCollectionPanel = new DomTableView(getProject(),getEmptyPaneText(),getHelpId()); } else { myCollectionPanel = boundComponent; } myCollectionPanel.setToolbaractions(new AddAction(),new Editaction(),new RemoveAction()); myCollectionPanel.installPopup(ActionPlaces.J2EE_ATTRIBUTES_VIEW_POPUP,createPopupActionGroup()); myCollectionPanel.initializeTable(); myCollectionPanel.addCustomDataProvider(this); myCollectionPanel.addchangelistener(new DomTableView.changelistener() { public void changed() { reset(); } }); reset(); }
public final void setToolbaractions(final AnAction... actions) { final DefaultActionGroup actionGroup = new DefaultActionGroup(); for (final AnAction action : actions) { actionGroup.add(action); } if (getHelpId() != null) { actionGroup.add(AnSeparator.getInstance()); actionGroup.add(new ContextHelpAction(getHelpId())); } final ActionManager actionManager = ActionManager.getInstance(); final ToolbarPosition position = getToolbarPosition(); final ActionToolbar myActionToolbar = actionManager.createActionToolbar(ActionPlaces.PROJECT_VIEW_TOOLBAR,position == ToolbarPosition.TOP || position == ToolbarPosition.BottOM); myActionToolbar.setTargetComponent(myInnerPanel); final JComponent toolbarComponent = myActionToolbar.getComponent(); final MatteBorder matteBorder = BorderFactory.createMatteBorder(0,position == ToolbarPosition.TOP ? 1 : 0,JBColor.DARK_GRAY); toolbarComponent.setBorder(BorderFactory.createCompoundBorder(matteBorder,toolbarComponent.getBorder())); getTable().getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { myActionToolbar.updateActionsImmediately(); } }); add(toolbarComponent,position.getPosition()); }
@Override protected void createTrees(@NotNull final Map<String,tree2); }
public void update(AnActionEvent e) { boolean enable = false; StackFrameProxyImpl stackFrameProxy = getStackFrameProxy(e); if(stackFrameProxy != null && isAtBreakpoint(e)) { VirtualMachineProxyImpl virtualMachineProxy = stackFrameProxy.getVirtualMachine(); enable = virtualMachineProxy.canPopFrames(); } if(ActionPlaces.MAIN_MENU.equals(e.getPlace()) || ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace())) { e.getPresentation().setEnabled(enable); } else { e.getPresentation().setVisible(enable); } }
public static ActionToolbar createActionToolbar(Tree componentsTree) { DefaultActionGroup defaultActionGroup = new DefaultActionGroup(); defaultActionGroup.addAction(ActionManager.getInstance().getAction("Xray.Refresh")); defaultActionGroup.addAction(new CollapseAllAction(componentsTree)); defaultActionGroup.addAction(new ExpandAllAction(componentsTree)); return ActionManager.getInstance().createActionToolbar(ActionPlaces.CHANGES_VIEW_TOOLBAR,defaultActionGroup,true); }
com.intellij.openapi.actionSystem.ActionToolbarPosition的实例源码
@Nullable @Override protected JComponent createCenterPanel() { ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTree). addExtraAction(new SelectAllButton()). addExtraAction(new UnselectAllButton()). addExtraAction(new ShowSelectedOnlyButton()). addExtraAction(new SelectrequiredButton()). setToolbarPosition(ActionToolbarPosition.BottOM). setToolbarBorder(IdeBorderFactory.createEmptyBorder()); contentPanel.add(decorator.createPanel()); loadingPanel = new JBLoadingPanel(new BorderLayout(),getdisposable()); loadingPanel.add(mainPanel,BorderLayout.CENTER); return loadingPanel; }
public UserRenderersConfigurable() { super(new BorderLayout(4,0)); myRendererChooser = new ElementsChooser<NodeRenderer>(true); setupRenderersList(); ToolbarDecorator decorator = ToolbarDecorator.createDecorator((JTable)myRendererChooser.getComponent()); decorator.setToolbarPosition(ActionToolbarPosition.TOP); decorator.setAddAction(new AddAction()); decorator.setRemoveAction(new RemoveAction()); decorator.setMoveUpAction(new MoveAction(true)); decorator.setMoveDownAction(new MoveAction(false)); decorator.addExtraAction(new copyAction()); myNameField = new JTextField(); myNameFieldPanel = new JPanel(new BorderLayout()); myNameFieldPanel.add(new JLabel(DebuggerBundle.message("label.user.renderers.configurable.renderer.name")),BorderLayout.WEST); myNameFieldPanel.add(myNameField,BorderLayout.CENTER); myNameFieldPanel.setVisible(false); final JPanel center = new JPanel(new BorderLayout(0,4)); center.add(myNameFieldPanel,BorderLayout.norTH); center.add(myRendererDataConfigurable,BorderLayout.CENTER); myNameField.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { if (myCurrentRenderer != null) { myCurrentRenderer.setName(myNameField.getText()); myRendererChooser.refresh(myCurrentRenderer); } } }); Splitter splitter = new Splitter(false); splitter.setProportion(0.3f); splitter.setFirstComponent(decorator.createPanel()); splitter.setSecondComponent(center); add(splitter,BorderLayout.CENTER); }
/** Sets up the the toolbar that appears in the cloud debugger snapshots panel. */ private void configuretoolbar() { final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(table) .disableupdownActions() .disableAddAction() .setToolbarPosition(ActionToolbarPosition.TOP); decorator.setRemoveAction(new RemoveSelectedBreakpointsAction()); decorator.addExtraAction(new RemoveAllBreakpointsAction()); decorator.addExtraAction(new ReactivateBreakpointAction()); this.add(decorator.createPanel()); }
@Override public ToolbarDecorator initPosition() { return setToolbarPosition(SystemInfo.isMac ? ActionToolbarPosition.BottOM : ActionToolbarPosition.TOP); }
@Override public ToolbarDecorator initPosition() { return setToolbarPosition(SystemInfo.isMac ? ActionToolbarPosition.BottOM : ActionToolbarPosition.TOP); }
@Override public ToolbarDecorator initPosition() { return setToolbarPosition(SystemInfo.isMac ? ActionToolbarPosition.BottOM : ActionToolbarPosition.TOP); }
public UserRenderersConfigurable() { super(new BorderLayout(JBUI.scale(4),0)); myRendererChooser = new ElementsChooser<NodeRenderer>(true); setupRenderersList(); ToolbarDecorator decorator = ToolbarDecorator.createDecorator((JTable) myRendererChooser.getComponent()); decorator.setToolbarPosition(ActionToolbarPosition.TOP); decorator.setAddAction(new AddAction()); decorator.setRemoveAction(new RemoveAction()); decorator.setMoveUpAction(new MoveAction(true)); decorator.setMoveDownAction(new MoveAction(false)); decorator.addExtraAction(new copyAction()); myNameField = new JTextField(); myNameFieldPanel = new JPanel(new BorderLayout()); myNameFieldPanel.add(new JLabel(DebuggerBundle.message("label.user.renderers.configurable.renderer.name")),BorderLayout.WEST); myNameFieldPanel.add(myNameField,BorderLayout.CENTER); myNameFieldPanel.setVisible(false); final JPanel center = new JPanel(new BorderLayout(0,4)); center.add(myNameFieldPanel,BorderLayout.norTH); center.add(myRendererDataConfigurable,BorderLayout.CENTER); myNameField.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { if(myCurrentRenderer != null) { myCurrentRenderer.setName(myNameField.getText()); myRendererChooser.refresh(myCurrentRenderer); } } }); Splitter splitter = new Splitter(false); splitter.setProportion(0.3f); splitter.setFirstComponent(decorator.createPanel()); splitter.setSecondComponent(center); add(splitter,BorderLayout.CENTER); }
com.intellij.openapi.actionSystem.EmptyAction的实例源码
private void setupComponents() { myHelper.setupEditor(myConsoleEditor); myHelper.setupEditor(myHistoryViewer); myHistoryViewer.getComponent().setMinimumSize(JBUI.emptySize()); myHistoryViewer.getComponent().setPreferredSize(JBUI.emptySize()); myHistoryViewer.setCaretEnabled(false); myConsoleEditor.setContextMenuGroupId(IdeActions.GROUP_CONSOLE_EDITOR_POPUP); myConsoleEditor.setHighlighter( EditorHighlighterFactory.getInstance().createEditorHighlighter(getVirtualFile(),myConsoleEditor.getColoRSScheme(),getProject())); myConsoleEditor.getScrollPane().getHorizontalScrollBar().setModel( myHistoryViewer.getScrollPane().getHorizontalScrollBar().getModel()); setHistoryScrollBarVisible(false); myHistoryViewer.getContentComponent().addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent event) { if (isConsoleEditorEnabled() && UIUtil.isReallyTypedEvent(event)) { myConsoleEditor.getContentComponent().requestFocus(); myConsoleEditor.processKeyTyped(event); } } }); EmptyAction.registeractionShortcuts(myHistoryViewer.getComponent(),myConsoleEditor.getComponent()); }
public ConsoleExecuteAction(@NotNull LanguageConsoleView consoleView,@NotNull ConsoleExecuteActionHandler executeActionHandler,@NotNull String emptyExecuteActionId,@Nullable Condition<LanguageConsoleView> enabledCondition) { super(null,null,AllIcons.Actions.Execute); myConsoleView = consoleView; myExecuteActionHandler = executeActionHandler; myEnabledCondition = enabledCondition == null ? Conditions.<LanguageConsoleView>alwaysTrue() : enabledCondition; EmptyAction.setupAction(this,emptyExecuteActionId,null); }
public ChangesbrowserWithRollback(@NotNull Project project,@NotNull List<Change> changes) { super(project,changes,false,true,MyUseCase.LOCAL_CHANGES,null); myOriginalChanges = changes; RollbackDialogAction rollback = new RollbackDialogAction(); EmptyAction.setupAction(rollback,IdeActions.CHANGES_VIEW_ROLLBACK,this); addToolbaraction(rollback); setChangesTodisplay(changes); }
private void configureActions() { EmptyAction.setupAction(myHistoryNext,"Console.History.Next",null); EmptyAction.setupAction(myHistoryPrev,"Console.History.PrevIoUs",null); EmptyAction.setupAction(mybrowseHistory,"Console.History.browse",null); if (!myMultiline) { EmptyAction.setupAction(mybrowseHistory,"Console.History.browseTW",null); myHistoryNext.registerCustomShortcutSet(KeyEvent.VK_UP,null); myHistoryPrev.registerCustomShortcutSet(KeyEvent.VK_DOWN,null); } myHistoryNext.registerCustomShortcutSet(myHistoryNext.getShortcutSet(),myConsole.getCurrentEditor().getComponent()); myHistoryPrev.registerCustomShortcutSet(myHistoryPrev.getShortcutSet(),myConsole.getCurrentEditor().getComponent()); mybrowseHistory.registerCustomShortcutSet(mybrowseHistory.getShortcutSet(),myConsole.getCurrentEditor().getComponent()); }
public static void register(@javax.annotation.Nullable Project project,@Nonnull Editor editor,@Nonnull JComponent component) { UndoManager undoManager = project != null ? UndoManager.getInstance(project) : UndoManager.getGlobalInstance(); TextEditor textEditor = TextEditorProvider.getInstance().getTextEditor(editor); if (undoManager != null) { EmptyAction.setupAction(new ProxyUndoRedoAction(undoManager,textEditor,true),IdeActions.ACTION_UNDO,component); EmptyAction.setupAction(new ProxyUndoRedoAction(undoManager,false),IdeActions.ACTION_REDO,component); } }
private void setupComponents() { myHelper.setupEditor(myConsoleEditor); myHelper.setupEditor(myHistoryViewer); myHistoryViewer.getComponent().setMinimumSize(JBUI.emptySize()); myHistoryViewer.getComponent().setPreferredSize(JBUI.emptySize()); myHistoryViewer.setCaretEnabled(false); myConsoleEditor.setContextMenuGroupId(IdeActions.GROUP_CONSOLE_EDITOR_POPUP); myConsoleEditor .setHighlighter(EditorHighlighterFactory.getInstance().createEditorHighlighter(getVirtualFile(),getProject())); setHistoryScrollBarVisible(false); myHistoryViewer.getContentComponent().addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent event) { if (isConsoleEditorEnabled() && UIUtil.isReallyTypedEvent(event)) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> { IdeFocusManager.getGlobalInstance().requestFocus(myConsoleEditor.getContentComponent(),true); }); myConsoleEditor.processKeyTyped(event); } } }); EmptyAction.registeractionShortcuts(myHistoryViewer.getComponent(),myConsoleEditor.getComponent()); }
public ConsoleExecuteAction(@Nonnull LanguageConsoleView consoleView,@Nonnull ConsoleExecuteActionHandler executeActionHandler,@Nonnull String emptyExecuteActionId,null); }
protected EnableLeft(DirDiffTableModel model) { super(model); EmptyAction.setupAction(this,"DirDiffMenu.EnableLeft",null); }
public EnableEqual(DirDiffTableModel model) { super(model); EmptyAction.setupAction(this,"DirDiffMenu.EnableEqual",null); }
protected EnableNotEqual(DirDiffTableModel model) { super(model); EmptyAction.setupAction(this,"DirDiffMenu.EnableNotEqual",null); }
protected EnableRight(DirDiffTableModel model) { super(model); EmptyAction.setupAction(this,"DirDiffMenu.EnableRight",null); }
public NextChangeAction() { setEnabledInModalContext(true); EmptyAction.setupAction(this,"Diff.NextChange",null); }
public NextDifferenceAction() { setEnabledInModalContext(true); EmptyAction.setupAction(this,IdeActions.ACTION_NEXT_DIFF,null); }
public PrevDifferenceAction() { setEnabledInModalContext(true); EmptyAction.setupAction(this,IdeActions.ACTION_PREVIoUS_DIFF,null); }
public PrevChangeAction() { setEnabledInModalContext(true); EmptyAction.setupAction(this,"Diff.PrevChange",null); }
public OpenInEditorAction(@Nullable Runnable afterRunnable) { EmptyAction.setupAction(this,"EditSource",null); myAfterRunnable = afterRunnable; }
public GotochangePopupAction() { setEnabledInModalContext(true); EmptyAction.setupAction(this,"GotochangedFile",null); }
public FocusOppositePaneAction(boolean scrollToPosition) { myScrollToPosition = scrollToPosition; setEnabledInModalContext(true); EmptyAction.setupAction(this,getActionId(),null); }
public AnnotateDiffViewerAction() { EmptyAction.setupAction(this,"Annotate",null); setEnabledInModalContext(true); }
private void hideIdeaActions() { hideAction("NewPackageInfo","package-info.java"); hideAction("NewForm","GUI Form"); hideAction("NewDialog","Dialog"); hideAction("NewFormSnapshot","Form Snapshot"); replaceAction("Groovy.NewClass",new EmptyAction()); replaceAction("Groovy.NewScript",new EmptyAction()); hideAction("NewModule","New Module..."); hideAction("NewModuleInGroup","Module"); hideAction("CreateLibraryFromFile","Add As Library..."); hideAction("ImportModule","Import Module..."); //hideAction(IdeActions.GROUP_MOVE_MODULE_TO_GROUP,"Move Module to Group"); hideAction(IdeActions.MODULE_SETTINGS,"Module Settings"); //hideAction(IdeActions.GROUP_WELCOME_SCREEN_DOC,"Docs and How-Tos"); //hideAction(IdeActions.GROUP_WELCOME_SCREEN_QUICKSTART,"WelcomeScreen.QuickStart"); //Todo: find name hideAction(IdeActions.ACTION_EXTERNAL_JAVADOC,"External Documentation"); hideAction(IdeActions.ACTION_QUICK_JAVADOC,"Quick Documentation"); hideAction("AddFrameworkSupport","Add Framework Support..."); hideAction(IdeActions.ACTION_GENERATE_ANT_BUILD,"Generate Ant Build..."); hideAction("BuildArtifact","Build Artifacts..."); hideAction("RunTargetAction","Run Ant Target"); hideAction(IdeActions.ACTION_MAKE_MODULE,"Make Module"); hideAction(IdeActions.ACTION_GENERATE_ANT_BUILD,"Generate Ant Build..."); hideAction(IdeActions.ACTION_INSPECT_CODE,"Inspect Code..."); //hideAction(IdeActions.GROUP_DEBUGGER,"DebuggerActions"); //Todo: find name hideAction(IdeActions.ACTION_DEFAULT_DEBUGGER,"Debug"); hideAction(IdeActions.ACTION_TOGGLE_LINE_BREAKPOINT,"Toggle Line Breakpoint"); //hideAction(IdeActions.GROUP_USAGE_VIEW_POPUP,"UsageView.Popup"); //Todo: find name hideAction(IdeActions.ACTION_GOTO_DECLaraTION,"Declaration"); hideAction(IdeActions.ACTION_GOTO_TYPE_DECLaraTION,"Type Declaration"); hideAction(IdeActions.ACTION_GOTO_IMPLEMENTATION,"Implementation(s)"); hideAction(IdeActions.ACTION_ANALYZE_DEPENDENCIES,"Analyze Dependencies..."); hideAction(IdeActions.ACTION_ANALYZE_BACK_DEPENDENCIES,"Analyze Backward Dependencies..."); hideAction(IdeActions.ACTION_ANALYZE_CYCLIC_DEPENDENCIES,"Analyze Cyclic Dependencies..."); //hideAction(IdeActions.GROUP_REFACTOR,"Refactor"); hideAction(IdeActions.ACTION_TYPE_HIERARCHY,"Class Hierarchy"); hideAction(IdeActions.ACTION_METHOD_HIERARCHY,"Method Hierarchy"); hideAction(IdeActions.ACTION_CALL_HIERARCHY,"Call Hierarchy"); //hideAction(IdeActions.GROUP_TYPE_HIERARCHY_POPUP,"TypeH ierarchy"); //hideAction(IdeActions.GROUP_METHOD_HIERARCHY_POPUP,"Method Hierarchy"); //hideAction(IdeActions.GROUP_CALL_HIERARCHY_POPUP,"Call Hierarchy"); //hideAction(IdeActions.GROUP_COMMANDER_POPUP,"Commander"); //hideAction(IdeActions.GROUP_TESTTREE_POPUP,"TestTreePopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_TESTSTATISTICS_POPUP,"TestStatisticsTablePopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_J2EE_VIEW_POPUP,"J2EEViewPopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_EJB_TRANSACTION_ATTRIBUTES_VIEW_POPUP,"EjbTransactionAttributesViewPopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_EJB_ENVIRONMENT_ENTRIES_VIEW_POPUP,"EjbEnvironmentEntriesViewPopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_EJB_REFERENCES_VIEW_POPUP,"EjbReferencesViewPopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_Security_ROLES_VIEW_POPUP,"SecurityRolesViewPopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_ParaMETERS_VIEW_POPUP,"ParametersViewPopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_SERVLET_MAPPING_VIEW_POPUP,"ServletMappingViewPopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_EJB_RESOURCE_REFERENCES_VIEW_POPUP,"EjbResourceReferencesViewPopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_EJB_RESOURCE_ENVIRONMENT_REFERENCES_VIEW_POPUP,"EjbResourceEnvironmentReferencesViewPopupMenu"); //Todo: find name //hideAction(IdeActions.GROUP_ADD_SUPPORT,"AddSupportGroup"); hideAction(IdeActions.ACTION_QUICK_IMPLEMENTATIONS,"Quick DeFinition"); }
protected EnableLeft(DirDiffTableModel model) { super(model); EmptyAction.setupAction(this,null); }
public EnableEqual(DirDiffTableModel model) { super(model); EmptyAction.setupAction(this,null); }
protected EnableNotEqual(DirDiffTableModel model) { super(model); EmptyAction.setupAction(this,null); }
protected EnableRight(DirDiffTableModel model) { super(model); EmptyAction.setupAction(this,null); }
public GotochangePopupAction() { setEnabledInModalContext(true); EmptyAction.setupAction(this,null); }
今天关于java.rmi.activation.ActivationSystem的实例源码和java validation源码解析的介绍到此结束,谢谢您的阅读,有关com.intellij.openapi.actionSystem.ActionGroupUtil的实例源码、com.intellij.openapi.actionSystem.ActionPlaces的实例源码、com.intellij.openapi.actionSystem.ActionToolbarPosition的实例源码、com.intellij.openapi.actionSystem.EmptyAction的实例源码等更多相关知识的信息可以在本站进行查询。
本文标签: