Examples of WindowManager


Examples of com.intellij.openapi.wm.WindowManager

    }
    //endregion

    highlightManager.addOccurrenceHighlights(
        editor, usages.toArray(new PsiElement[usages.size()]), textattributes, false, null);
    final WindowManager windowManager = WindowManager.getInstance();
    final StatusBar statusBar = windowManager.getStatusBar(project);
    assert statusBar != null;
    statusBar.setInfo("Press Esc to remove highlighting");
  }
View Full Code Here

Examples of com.intellij.openapi.wm.WindowManager

  public synchronized Point getLocation(@NotNull String key, Project project) {
    key = realKey(key, project);

    Point point=myKey2Location.get(key);
    if(point!=null){
      WindowManager windowManager=WindowManager.getInstance();
      if(!windowManager.isInsideScreenBounds(point.x,point.y)){
        point=null;
      }
    }
    if(point!=null){
      return (Point)point.clone();
View Full Code Here

Examples of gov.nasa.arc.mct.platform.spi.WindowManager

            return true;
        }
       
        // Get references to platform and window manager; these will be used a few times
        Platform platform = PlatformAccess.getPlatform();
        WindowManager windowManager = platform.getWindowManager();
       
        // Can only complete action if there are no components which cannot be removed
        String confirm = BUNDLE.getString("SaveConfirm");
        String abort = BUNDLE.getString("SaveAbort");
        String[] options = { confirm, abort };

        // Issue a warning dialog to the user
        Map<String, Object> hints = new HashMap<String, Object>();
        hints.put(WindowManagerImpl.PARENT_COMPONENT, actionContext.getWindowManifestation());
        hints.put(WindowManagerImpl.OPTION_TYPE, OptionBox.YES_NO_OPTION);
        hints.put(WindowManagerImpl.MESSAGE_TYPE, OptionBox.WARNING_MESSAGE);
        hints.put(WindowManagerImpl.MESSAGE_OBJECT, buildWarningPanel(canSave, cannotSave));
        String choice = windowManager.showInputDialog(
                BUNDLE.getString("SaveWarningTitle"), //title
                "", // message - will be overridden by custom object
                options, // options
                null, // default option
                hints); // hints
View Full Code Here

Examples of gov.nasa.arc.mct.platform.spi.WindowManager

   
    private void handleWarnings(Collection<AbstractComponent> toDelete, Collection<AbstractComponent> toRemove,
            Collection<AbstractComponent> cannotRemove) {
        // Get references to platform and window manager; these will be used a few times
        Platform platform = PlatformAccess.getPlatform();
        WindowManager windowManager = platform.getWindowManager();
       
        // Can only complete action if there are no components which cannot be removed
        if (cannotRemove.isEmpty()) {
            String confirm = bundle.getString("DeleteAllCoreText");
            String abort = bundle.getString("DeleteAllAbortText");
            String[] options = { confirm, abort };

            // Issue a warning dialog to the user
            Map<String, Object> hints = new HashMap<String, Object>();
            hints.put(WindowManagerImpl.PARENT_COMPONENT, actionContext.getWindowManifestation());
            hints.put(WindowManagerImpl.OPTION_TYPE, OptionBox.YES_NO_OPTION);
            hints.put(WindowManagerImpl.MESSAGE_TYPE, OptionBox.WARNING_MESSAGE);
            hints.put(WindowManagerImpl.MESSAGE_OBJECT, buildWarningPanel(toDelete, toRemove));
            String choice = windowManager.showInputDialog(
                    WARNING, //title
                    "", // message - will be overridden by custom object
                    options, // options
                    null, // default option
                    hints); // hints
           
            // Complete the action, if the user has confirmed it
            if (confirm.equals(choice)) {
                for (AbstractComponent delete : toDelete) {
                    windowManager.closeWindows(delete.getComponentId());
                }
                platform.getPersistenceProvider().delete(toDelete);
            }           
        } else {      
            // Some components cannot be removed safely - let the user know this
            String ok = bundle.getString("DeleteAllErrorConfirm");
            Map<String, Object> hints = new HashMap<String, Object>();
            hints.put(WindowManagerImpl.PARENT_COMPONENT, actionContext.getWindowManifestation());
            hints.put(WindowManagerImpl.MESSAGE_TYPE, OptionBox.ERROR_MESSAGE);
            windowManager.showInputDialog(
                    "ERROR: "+ WARNING, //title
                    bundle.getString("DeleteAllErrorHasDescendantsText"), // message
                    new String[] { ok }, // options
                    ok, // default option
                    hints); // hints (none)
View Full Code Here

Examples of gov.nasa.arc.mct.platform.spi.WindowManager

        ContextAwareAction quit = new QuitAction();
        Mockito.reset(mockRuntime);
       
        // Set up window manager to support dialog call
        // Act as though the user clicked "OK" or "Cancel" (depending on argument "confirmed")
        WindowManager mockWindowManager = Mockito.mock(WindowManager.class);
        Mockito.when(mockPlatform.getWindowManager()).thenReturn(mockWindowManager);
        Mockito.when(mockWindowManager.showInputDialog(Mockito.anyString(), Mockito.anyString(), Mockito.<Object[]>any(), Mockito.any(), Mockito.<Map<String,Object>>any())).thenAnswer(new Answer<Object>() {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable {
                Object[] options = (Object[]) invocation.getArguments()[2];
                return confirmed ? options[0] : options[1]; // options[0] presumed to mean "OK"
            }
View Full Code Here

Examples of gov.nasa.arc.mct.platform.spi.WindowManager

        // Generate a new persistence provider each time
        PersistenceProvider persistence = Mockito.mock(PersistenceProvider.class);
        Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(persistence);

        // Ensure dialog choice
        WindowManager windowing = Mockito.mock(WindowManager.class);
        Mockito.when(mockPlatform.getWindowManager()).thenReturn(windowing);
        Mockito.when(windowing.<Object>showInputDialog(
                Mockito.anyString(), Mockito.anyString(),
                Mockito.<Object[]>any(), Mockito.any(),
                Mockito.<Map<String,Object>>any()))
                .thenReturn(confirm ? "Save" : "Cancel");
       
View Full Code Here

Examples of gov.nasa.arc.mct.platform.spi.WindowManager

        ContextAwareAction quit = new QuitAction();
        Mockito.reset(mockRuntime);
       
        // Set up window manager to support dialog call
        // Act as though the user clicked "OK" or "Cancel" (depending on argument "confirmed")
        WindowManager mockWindowManager = Mockito.mock(WindowManager.class);
        Mockito.when(mockPlatform.getWindowManager()).thenReturn(mockWindowManager);
        Mockito.when(mockWindowManager.showInputDialog(Mockito.anyString(), Mockito.anyString(), Mockito.<Object[]>any(), Mockito.any(), Mockito.<Map<String,Object>>any())).thenAnswer(new Answer<Object>() {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable {
                Object[] options = (Object[]) invocation.getArguments()[2];
                return confirmed ? options[0] : options[1]; // options[0] presumed to mean "OK"
            }
View Full Code Here

Examples of gov.nasa.arc.mct.platform.spi.WindowManager

     * @param graphicsConfig - Detect multiple display monitor devices
     */
    public final void open(GraphicsConfiguration graphicsConfig) {
        Platform platform = PlatformAccess.getPlatform();
        assert platform != null;
        WindowManager windowManager = platform.getWindowManager();
        if (platform.getRootComponent() == this)
            windowManager.openInNewWindow(this, graphicsConfig);
        else
            windowManager.openInNewWindow(PlatformAccess.getPlatform().getPersistenceProvider().getComponent(getComponentId()), graphicsConfig);
    }
View Full Code Here

Examples of gov.nasa.arc.mct.platform.spi.WindowManager

        PlatformAccess access = new PlatformAccess();
        Platform mockPlatform = Mockito.mock(Platform.class);
        PersistenceProvider mockPersistenceProvider = Mockito.mock(PersistenceProvider.class);
        PolicyManager mockpoPolicyManager = Mockito.mock(PolicyManager.class);      
        CoreComponentRegistry mockComponentRegistry = Mockito.mock(CoreComponentRegistry.class);
        WindowManager mockWindowManager = Mockito.mock(WindowManager.class);
       
        access.setPlatform(mockPlatform);
        Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockPersistenceProvider);
        Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
        Mockito.when(mockPlatform.getComponentRegistry()).thenReturn(mockComponentRegistry);
        Mockito.when(mockPlatform.getWindowManager()).thenReturn(mockWindowManager);
        ExecutionResult mockResult = new ExecutionResult(new PolicyContext(), true, "");
        Mockito.when(mockpoPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(mockResult);
        Mockito.when(mockWindowManager.<Object>showInputDialog(
                Mockito.anyString(), Mockito.anyString(), Mockito.<Object[]>any(), Mockito.any(), Mockito.anyMap()))
                .thenAnswer(new Answer<Object>() {
                    @Override
                    public Object answer(InvocationOnMock invocation) throws Throwable {
                        return ((Object[])invocation.getArguments()[2])[0];
View Full Code Here

Examples of gov.nasa.arc.mct.platform.spi.WindowManager

        PlatformAccess access = new PlatformAccess();
        Platform mockPlatform = Mockito.mock(Platform.class);
        PersistenceProvider mockPersistenceProvider = Mockito.mock(PersistenceProvider.class);
        PolicyManager mockpoPolicyManager = Mockito.mock(PolicyManager.class);      
        CoreComponentRegistry mockComponentRegistry = Mockito.mock(CoreComponentRegistry.class);
        WindowManager mockWindowManager = Mockito.mock(WindowManager.class);
       
        access.setPlatform(mockPlatform);
        Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockPersistenceProvider);
        Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);       
        ExecutionResult mockResult = new ExecutionResult(new PolicyContext(), true, "");
        Mockito.when(mockpoPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(mockResult);
        Mockito.when(mockPlatform.getComponentRegistry()).thenReturn(mockComponentRegistry);
        Mockito.when(mockPlatform.getWindowManager()).thenReturn(mockWindowManager);
        Mockito.when(mockWindowManager.<Object>showInputDialog(
                Mockito.anyString(), Mockito.anyString(), Mockito.<Object[]>any(), Mockito.any(), Mockito.anyMap()))
                .thenAnswer(new Answer<Object>() {
                    @Override
                    public Object answer(InvocationOnMock invocation) throws Throwable {
                        return ((Object[])invocation.getArguments()[2])[0];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.