Created RtTerminalsView to access SerialConnector.
RtExtensionView is Wrapping TerminalsView with RtTerminalsView.
This is because the parent class is required to access the Serial
Connector.
Change-Id: I68124d0788dd3f70d51f22b82656888272ff6181
Signed-off-by: JaeMin Kim <jm.jemin.kim@samsung.com>
}
data = new HashMap<String, Object>();
+ /* Tizen */
+ // Apply RtTerminalsView instead of TerminalsView
+ data.put(ITerminalsConnectorConstants.PROP_ID, "org.tizen.rt.ide.view.RtTerminalsView");
+ /* ===== */
+
// Store the id of the selected delegate
String terminalLabel = terminals != null ? terminals.getText() : singleDelegateLabel;
String delegateId = terminalLabel != null ? label2delegate.get(terminalLabel).getId() : null;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelectionChangedListener;
// Reference to the selection listener
private ToolbarSelectionChangedListener selectionChangedListener;
// The list of actions available within the toolbar
- private final List<AbstractTerminalAction> toolbarActions = new ArrayList<AbstractTerminalAction>();
+ protected final List<AbstractTerminalAction> toolbarActions = new ArrayList<AbstractTerminalAction>();
/**
* Default selection listener implementation.
// Update actions
updateToolbarItems(false);
-
- /* Tizen - Add menubar */
- // Fill the menubar
- IMenuManager menuManager = bars.getMenuManager();
- doFillMenubar(menuManager);
- /* ===== */
}
/**
});
}
- /* Tizen */
- private void doFillMenubar(IMenuManager menuManager) {
- // we want that at the end
- AbstractTerminalAction pasteAction = null;
-
- for(AbstractTerminalAction action : toolbarActions) {
- // Fill only copy, paste action in menubar
- if(action instanceof TerminalActionCopy) {
- menuManager.add(action);
- } else if(action instanceof TerminalActionPaste) {
- pasteAction = action;
- }
- }
- // now add to the end
- if(pasteAction != null) {
- menuManager.add(pasteAction);
- }
- }
- /* ===== */
-
/**
* Fill in the context menu content within the given manager.
*
// Loop all actions and add them to the menu manager
for (AbstractTerminalAction action : toolbarActions) {
- /* Tizen */
- // Skip copy, paste action
- if(action instanceof TerminalActionCopy || action instanceof TerminalActionPaste) {
- continue;
- }
- /* ===== */
// Add a separator before the clear all action or if the action is a separator
if (action instanceof TabScrollLockAction
|| (action instanceof AbstractAction && ((AbstractAction)action).isSeparator())) {
newTerminalAction = (NewTerminalViewAction)action;
continue;
}
+
// Add the action itself
manager.insertAfter("anchor", action); //$NON-NLS-1$
}
// now add to the end
- /* Tizen */
- manager.add(new Separator());
- /* ===== */
+
if (newTerminalAction != null){
manager.add(newTerminalAction);
}
+
}
/**
</command>
</toolbar>
</menuContribution>
+ <!-- for terminal start-->
+ <menuContribution locationURI="toolbar:org.tizen.rt.ide.view.RtTerminalsView">
+ <command
+ commandId="org.eclipse.tm.terminal.view.ui.command.launchToolbar"
+ icon="icons/terminal/view_menu_open_t_nor.png"
+ id="org.eclipse.tm.terminal.view.ui.commands.launchToolbarTerminalsView"
+ label="%command.launch.label"
+ style="push"
+ tooltip="%command.launch.tooltip">
+ </command>
+ <command
+ commandId="org.eclipse.tm.terminal.view.ui.command.disconnect"
+ icon="icons/terminal/view_menu_disconnect_terminal_nor.png"
+ id="org.eclipse.tm.terminal.view.ui.commands.disconnect"
+ label="%command.disconnect.label"
+ style="push"
+ tooltip="%command.disconnect.tooltip">
+ </command>
+ </menuContribution>
+ <!-- for terminal end-->
+
</extension>
<extension
id="product"
id="org.eclipse.tm.terminal.view.ui.commands.launchToolbar">
</hiddenToolBarItem>
<view
- id="org.eclipse.tm.terminal.view.ui.TerminalsView"
+ id="org.tizen.rt.ide.view.RtTerminalsView"
minimized="false"
relationship="stack"
relative="org.eclipse.cdt.debug.ui.executablesView">
name="Project Explorer"
restorable="true">
</view>
+ <!-- For Wrapping TerminalsView with RtTerminalsView. start -->
+ <view
+ class="org.tizen.rt.ide.views.RtTerminalsViewEx"
+ id="org.tizen.rt.ide.view.RtTerminalsView"
+ icon="icons/terminal/tab_terminal_view.png"
+ name="Terminal"
+ restorable="true">
+ </view>
+ <!-- For Wrapping TerminalsView with RtTerminalsView. end -->
</extension>
<!-- Defined Activity -->
<extension point="org.eclipse.ui.activities">
IFolderLayout bottom = factory.createFolder("bottomRight", //$NON-NLS-1$
IPageLayout.BOTTOM, 0.75f, factory.getEditorArea());
bottom.addView(IConsoleConstants.ID_CONSOLE_VIEW);
- bottom.addView("org.eclipse.tm.terminal.view.ui.TerminalsView"); //$NON-NLS-1$
+ bottom.addView("org.tizen.rt.ide.view.RtTerminalsView"); //$NON-NLS-1$
bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
IFolderLayout topRight = factory.createFolder("topRight", //$NON-NLS-1$
--- /dev/null
+/*
+* TabFolderToolbarHandlerEx
+*
+* Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Jaemin Kim <jm.jemin.kim@samsung.com>
+* HyeongSeok Heo <harry.heo@samsung.com>
+*
+* Licensed 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.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+package org.tizen.rt.ide.views;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tm.terminal.view.ui.interfaces.ITerminalsView;
+import org.eclipse.tm.terminal.view.ui.tabs.TabFolderToolbarHandler;
+import org.eclipse.tm.terminal.view.ui.view.TerminalsView;
+
+public class RtTerminalsViewEx extends TerminalsView {
+
+ public RtTerminalsViewEx() {
+ super();
+ }
+
+ @Override
+ protected TabFolderToolbarHandler doCreateTabFolderToolbarHandler(ITerminalsView parentView) {
+ Assert.isNotNull(parentView);
+ return new TabFolderToolbarHandlerEx(parentView);
+ }
+
+}
--- /dev/null
+/*
+* TabFolderToolbarHandlerEx
+*
+* Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Jaemin Kim <jm.jemin.kim@samsung.com>
+* HyeongSeok Heo <harry.heo@samsung.com>
+*
+* Licensed 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.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
+package org.tizen.rt.ide.views;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.tm.internal.terminal.control.ITerminalViewControl;
+import org.eclipse.tm.internal.terminal.control.actions.AbstractTerminalAction;
+import org.eclipse.tm.internal.terminal.control.actions.TerminalActionCopy;
+import org.eclipse.tm.internal.terminal.control.actions.TerminalActionPaste;
+import org.eclipse.tm.terminal.view.ui.actions.AbstractAction;
+import org.eclipse.tm.terminal.view.ui.actions.NewTerminalViewAction;
+import org.eclipse.tm.terminal.view.ui.actions.TabScrollLockAction;
+import org.eclipse.tm.terminal.view.ui.interfaces.ITerminalsView;
+import org.eclipse.tm.terminal.view.ui.tabs.TabFolderToolbarHandler;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+
+public class TabFolderToolbarHandlerEx extends TabFolderToolbarHandler {
+
+ public TabFolderToolbarHandlerEx(ITerminalsView parentView) {
+ super(parentView);
+ }
+
+ @Override
+ public void initialize() {
+ super.initialize();
+
+ // Fill the menubar
+ IActionBars bars = getParentView().getViewSite().getActionBars();
+ IMenuManager menuManager = bars.getMenuManager();
+ doFillMenubar(menuManager);
+
+ }
+
+ private void doFillMenubar(IMenuManager menuManager) {
+ // we want that at the end
+ AbstractTerminalAction pasteAction = null;
+
+ for (AbstractTerminalAction action : toolbarActions) {
+ // Fill only copy, paste action in menubar
+ if (action instanceof TerminalActionCopy) {
+ menuManager.add(action);
+ } else if (action instanceof TerminalActionPaste) {
+ pasteAction = action;
+ }
+ }
+ // now add to the end
+ if (pasteAction != null) {
+ menuManager.add(pasteAction);
+ }
+ }
+
+ /**
+ * Fill in the context menu content within the given manager.
+ * @param manager The menu manager. Must not be <code>null</code>.
+ */
+ @Override
+ protected void doFillToolbar(IToolBarManager manager) {
+ Assert.isNotNull(manager);
+
+ // Note: For the toolbar, the actions are added from left to right!
+ // So we start with the additions marker here which is the most
+ // left contribution item.
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ manager.add(new Separator("anchor")); //$NON-NLS-1$
+
+ // we want that at the end
+ NewTerminalViewAction newTerminalAction = null;
+
+ // The code that exists to specify the location of savelog.
+ ToggleSaveLogAction toggleSaveLogAction = null;
+
+ // Loop all actions and add them to the menu manager
+ for (AbstractTerminalAction action : toolbarActions) {
+ // Skip copy, paste action
+ if (action instanceof TerminalActionCopy || action instanceof TerminalActionPaste) {
+ continue;
+ }
+ // Add a separator before the clear all action or if the action is a separator
+ if (action instanceof TabScrollLockAction
+ || (action instanceof AbstractAction && ((AbstractAction) action).isSeparator())) {
+ manager.insertAfter("anchor", new Separator()); //$NON-NLS-1$
+ }
+ // skip new terminal view action for now
+ if (action instanceof NewTerminalViewAction) {
+ newTerminalAction = (NewTerminalViewAction) action;
+ continue;
+ }
+
+ // Add the action itself
+ manager.insertAfter("anchor", action); //$NON-NLS-1$
+ }
+ // now add to the end
+ manager.add(new Separator());
+
+ if (newTerminalAction != null) {
+ manager.add(newTerminalAction);
+ }
+ }
+}