Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JBIDE-19178] Simple deployment view
- Loading branch information
Showing
17 changed files
with
431 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
....ui/src/org/jboss/tools/openshift/internal/common/ui/explorer/DefaultPropertySection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2015 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.openshift.internal.common.ui.explorer; | ||
|
||
import org.eclipse.jface.viewers.ISelection; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.ui.IWorkbenchPart; | ||
import org.eclipse.ui.views.properties.PropertySheetPage; | ||
import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection; | ||
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; | ||
|
||
public class DefaultPropertySection extends AbstractPropertySection { | ||
|
||
private PropertySheetPage page; | ||
|
||
public DefaultPropertySection() { | ||
page = new PropertySheetPage(); | ||
} | ||
|
||
@Override | ||
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { | ||
page.createControl(parent); | ||
} | ||
|
||
|
||
@Override | ||
public boolean shouldUseExtraSpace() { | ||
return true; | ||
} | ||
|
||
|
||
@Override | ||
public void dispose() { | ||
page.dispose(); | ||
} | ||
|
||
@Override | ||
public void setInput(IWorkbenchPart part, ISelection selection) { | ||
super.setInput(part, selection); | ||
page.selectionChanged(part, selection); | ||
} | ||
|
||
@Override | ||
public void refresh() { | ||
page.refresh(); | ||
} | ||
|
||
} |
64 changes: 64 additions & 0 deletions
64
...tools/openshift/internal/common/ui/explorer/ExplorerViewTabbedPropertyAdapterFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2015 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.openshift.internal.common.ui.explorer; | ||
|
||
import org.eclipse.core.runtime.IAdapterFactory; | ||
import org.eclipse.ui.IWorkbenchPage; | ||
import org.eclipse.ui.IWorkbenchPart; | ||
import org.eclipse.ui.IWorkbenchWindow; | ||
import org.eclipse.ui.PlatformUI; | ||
import org.eclipse.ui.views.properties.IPropertySheetPage; | ||
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor; | ||
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; | ||
|
||
/** | ||
* An adapter factory to provide a tabbed property view in support of the | ||
* OpenShift explorer | ||
* | ||
* @author jeff.cantrill | ||
* | ||
*/ | ||
public class ExplorerViewTabbedPropertyAdapterFactory implements IAdapterFactory { | ||
private static final String VIEW_ID = "org.jboss.tools.openshift.express.ui.explorer.expressConsoleView"; | ||
|
||
@SuppressWarnings({ "unchecked", "rawtypes" }) | ||
public Object getAdapter(Object adaptableObject, Class adapterType) { | ||
if (adapterType == IPropertySheetPage.class) { | ||
IWorkbenchPart found = findView(VIEW_ID); | ||
if (found != null) { | ||
ITabbedPropertySheetPageContributor contrib = new ITabbedPropertySheetPageContributor() { | ||
public String getContributorId() { | ||
return VIEW_ID; | ||
} | ||
}; | ||
return new TabbedPropertySheetPage(contrib); | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public Class<?>[] getAdapterList() { | ||
return new Class[] { IPropertySheetPage.class }; | ||
} | ||
|
||
private IWorkbenchPart findView(String id) { | ||
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); | ||
if (window != null) { | ||
IWorkbenchPage page = window.getActivePage(); | ||
if (page != null) { | ||
IWorkbenchPart part = page.findView(id); | ||
return part; | ||
} | ||
} | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...oss.tools.openshift.ui/src/org/jboss/tools/openshift/internal/ui/explorer/Deployment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2015 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.openshift.internal.ui.explorer; | ||
|
||
<<<<<<< HEAD | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
======= | ||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
>>>>>>> [JBIDE-19178] Simple deployment view | ||
|
||
import com.openshift.restclient.model.IPod; | ||
import com.openshift.restclient.model.IService; | ||
import com.openshift.restclient.model.route.IRoute; | ||
|
||
/** | ||
* A deployment is the collection of resources | ||
* that makes up an 'application' | ||
* | ||
* @author jeff.cantrill | ||
* | ||
*/ | ||
public class Deployment { | ||
|
||
private IService service; | ||
private Set<IRoute> routes; | ||
private Set<IPod> pods; | ||
|
||
public Deployment(IService service, Collection<IRoute> routes, Collection<IPod> pods) { | ||
this.service = service; | ||
this.pods = new HashSet<>(pods); | ||
this.routes = new HashSet<>(routes); | ||
} | ||
|
||
public Collection<IPod> getPods() { | ||
return Collections.unmodifiableSet(pods); | ||
} | ||
public Collection<IRoute> getRoutes() { | ||
return Collections.unmodifiableSet(this.routes); | ||
} | ||
public IService getService() { | ||
return this.service; | ||
} | ||
|
||
public void add(IPod pod) { | ||
this.pods.add(pod); | ||
} | ||
|
||
public void remove(IPod pod) { | ||
this.pods.remove(pod); | ||
} | ||
|
||
} |
Oops, something went wrong.