forked from apache/hop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
154 additions
and
334 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
147 changes: 147 additions & 0 deletions
147
...ch/hopserver/src/main/java/org/apache/hop/hopserver/perspective/HopServerPerspective.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,147 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.hop.hopserver.perspective; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import org.apache.hop.core.gui.plugin.GuiPlugin; | ||
import org.apache.hop.core.search.ISearchable; | ||
import org.apache.hop.ui.core.PropsUi; | ||
import org.apache.hop.ui.hopgui.HopGui; | ||
import org.apache.hop.ui.hopgui.context.IGuiContextHandler; | ||
import org.apache.hop.ui.hopgui.file.IHopFileType; | ||
import org.apache.hop.ui.hopgui.file.IHopFileTypeHandler; | ||
import org.apache.hop.ui.hopgui.perspective.HopPerspectivePlugin; | ||
import org.apache.hop.ui.hopgui.perspective.IHopPerspective; | ||
import org.apache.hop.ui.hopgui.perspective.TabItemHandler; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.browser.Browser; | ||
import org.eclipse.swt.layout.GridData; | ||
import org.eclipse.swt.layout.GridLayout; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.swt.widgets.Control; | ||
|
||
@HopPerspectivePlugin( | ||
id = "HopServerPerspective", | ||
name = "Hop Server", | ||
description = "Hop Server", | ||
image = "ui/images/server.svg") | ||
@GuiPlugin | ||
public class HopServerPerspective implements IHopPerspective { | ||
|
||
public static final Class<?> PKG = HopServerPerspective.class; | ||
public static final String ID_PERSPECTIVE_TOOLBAR_ITEM = "9900-perspective-hopserver"; | ||
private HopGui hopGui; | ||
private Composite parent; | ||
private Composite composite; | ||
private Browser browser; | ||
|
||
public HopServerPerspective() {} | ||
|
||
@Override | ||
public List<IGuiContextHandler> getContextHandlers() { | ||
List<IGuiContextHandler> handlers = new ArrayList<>(); | ||
return handlers; | ||
} | ||
|
||
@Override | ||
public String getId() { | ||
return "HopServerPerspective"; | ||
} | ||
|
||
@Override | ||
public IHopFileTypeHandler getActiveFileTypeHandler() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void setActiveFileTypeHandler(IHopFileTypeHandler activeFileTypeHandler) {} | ||
|
||
@Override | ||
public List<IHopFileType> getSupportedHopFileTypes() { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public void activate() { | ||
hopGui.setActivePerspective(this); | ||
} | ||
|
||
@Override | ||
public void perspectiveActivated() { | ||
browser.setUrl("http://localhost:8080/"); | ||
browser.refresh(); | ||
} | ||
|
||
@Override | ||
public void navigateToPreviousFile() {} | ||
|
||
@Override | ||
public void navigateToNextFile() {} | ||
|
||
@Override | ||
public boolean isActive() { | ||
return hopGui.isActivePerspective(this); | ||
} | ||
|
||
@Override | ||
public void initialize(HopGui hopGui, Composite parent) { | ||
this.hopGui = hopGui; | ||
this.parent = parent; | ||
|
||
composite = new Composite(parent, SWT.NONE); | ||
composite.setLayout(new GridLayout()); | ||
PropsUi.setLook(composite); | ||
|
||
browser = new Browser(composite, SWT.NONE); | ||
browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); | ||
composite.setLayoutData(browser); | ||
} | ||
|
||
@Override | ||
public boolean hasNavigationPreviousFile() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean hasNavigationNextFile() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public Control getControl() { | ||
return composite; | ||
} | ||
|
||
@Override | ||
public boolean remove(IHopFileTypeHandler typeHandler) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public List<TabItemHandler> getItems() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public List<ISearchable> getSearchables() { | ||
List<ISearchable> searchables = new ArrayList<>(); | ||
return searchables; | ||
} | ||
} |
159 changes: 0 additions & 159 deletions
159
...opserver/src/main/java/org/apache/hop/hopserver/perspective/HopServerPerspective.java.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.